导航表单上的VBA程序 [英] VBA procedures on navigation forms

查看:77
本文介绍了导航表单上的VBA程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,¥b $ b

这是我第一次在本网站发帖,所以我们非常感谢任何信息或指导。我提前为这个冗长道歉,但这个问题很难解释。我有一个导航表单,有5个选项卡,其中四个打开各种表单和
报告没有问题。第五个选项卡打开仪表板表单,该表单由6个子表单组成。仪表板表单具有VBA,可根据记录计数中提取的记录数量调整每个子表单高度,并且与
导航表单分开打开时工作正常。在导航表单中打开仪表板表单时,触发子表单大小调整的脏事件都会生成错误,表明访问时不支持对象方法。我可以使用
执行其他事件(例如重新查询)以及导航表单和子表单的VBA表单路径。但是每次从仪表板形式触发的脏事件都会出错。我的理解这与导航子窗体控制有关,并且它不假设子窗体
控件名称。如果有任何解决方法,我会感到茫然。我一直在更多的论坛和网站上使用BrowseTo,SourceObject等等尝试了许多组合,但是无法使用任何组合
来工作。我不确定为什么某些事件有效而其他事件没有,例如:

This is my first time posting on this site so any info or guidance is appreciated. I apologize in advance for the wordiness but the issue is kind of difficult to explain. I have a navigation form that has 5 tabs, four of which open various forms and reports without issue. The fifth tabs opens a dashboard form that is comprised of 6 subforms. The dashboard form has VBA that sizes each subform height based off the number of records pulled in a record count and works just fine when opened separate from the navigation form. When the dashboard form is opened in the navigation form the dirty events that trigger the sizing on the subforms all generate errors stating that object method is not supported in access. I am able to carry out other events (such as requery) using the VBA form paths for the navigation form and subforms. but the dirty events triggered from the dashboard form error out every time. Its my understanding this has to do with navigation subform control and the fact that it does not assume the subform control name. I am at a loss if there are any workaround for this. I have been on more forums and sites than I can count and have tried numerous combinations using BrowseTo, SourceObject, etc... commands but have not been able to get any combo to work. I am not sure why some events work and others do not, for example:

以下代码将在用户使用条目表单输入后重新查询仪表板表单上的每日日志子表单。

the following code will requery the daily log subform on the dashboard form after a user makes an entry using the entry form.

表格![导航表格]![NavigationSubForm]![frm_DailyLog] .requery

Forms![Navigation Form]![NavigationSubForm]![frm_DailyLog].requery

但任务表单中的以下代码(短划线)包含子表单的板表单在单独打开时工作正常,但在使用导航表单上的选项卡打开时则不行。

however the following code in the Mission form (the dash board form that contains the subforms) works just fine when opened by itself but not when opened using the tab on the navigation form.

表单![导航表单]![NavigationSubForm]![frm_Mission ] .Form_Dirty(intCancel)

Forms![Navigation Form]![NavigationSubForm]![frm_Mission].Form_Dirty (intCancel)

我尝试了更多的控制路径组合而不是我可以计算,并且不确定这是否只是导航表单和控制参考的固有问题。在使用VBA时加载的表单或我只是遗漏了某些内容。

I have tried more combos of control paths than I can count and am not sure if this is just an inherent problem with navigation forms and control references available for the forms that are loaded while using VBA or I am just missing something.

同样,任何帮助都表示赞赏。

Again, any help is appreciated.

推荐答案

我很惊讶您的第一个代码示例工作。通常,子子表单的语法是:

I am surprised your first code sample works. Typically the syntax for sub-subforms is:

forms!myform!mysubformcontrol.form!mysubsubformcontrol.form

forms!myform!mysubformcontrol.form!mysubsubformcontrol.form

另外,如果你想调用一个从表单外部的事件过程,确保它是公共的。

Also, if you want to call an event procedure from outside the form, make sure it is Public.


这篇关于导航表单上的VBA程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆