如何在Access 2010中为BrowseTo指定PathToSubformControl [英] How to specify PathToSubformControl for BrowseTo in access 2010

查看:156
本文介绍了如何在Access 2010中为BrowseTo指定PathToSubformControl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我使用BrowseTo宏吗?我无法弄清ACCESS 2010中this宏中的参数之一,即 PathToSubformControl 。我有一个称为 frm_navigation的表格:

Could someone help me with BrowseTo macro plsease? I cannot figure out one of the arguments in the this macro in ACCESS 2010 which is PathToSubformControl. I have this Form called "frm_navigation":

所有选项卡的名称为:nav_vacancies,nav_contacts,nav_organizations等。
图中的组织名称字段将保存来自另一个表tbl_organizations的名称。但是,组织选项卡(左第三)将显示表tbl_organizations中的所有信息。

The names of all Tab are: nav_vacancies, nav_contacts, nav_organizations etc. The field "Organization name" in the figure will hold the name from another table tbl_organizations. However, the Tab "Organizations" (the third from left) will display all info from the table tbl_organizations.

我想编写一个将我带到组织选项卡的按钮并根据组织名称字段中显示的名称设置当前记录。

I would like to program a button that takes me to Organization Tab and set a current record according to the name displayed in the field "Organizations name".

到目前为止,我是通过DoCmd.OpenForm完成的,但它过滤掉了所有其他记录并打开一个新窗口。我尝试将BrowseTo操作设置如下:

So far I did it via DoCmd.OpenForm but it filters out all other records and opens a new window. I tried to set BrowseTo action as follows:

    DoCmd.BrowseTo acBrowseToForm, "frm_Organizations", "frm_navigation.nav_organizations", "[tbl_organizations].[PR_ID]=" & Me.cb_org_name.Value

但是我遇到了运行时错误,因为PathToSubformControl错误。我应该如何指定路径?我不了解结构。应该遵循以下模式:MainForm1.Subform1> Form1.Subform1,但没有解释什么是什么。

but I've got runtime error as my PathToSubformControl is wrong. How am I supposed to specify the path? I cannot understand the structure. It's supposed to follow this pattern: MainForm1.Subform1 > Form1.Subform1 but it's not explained what is what.

谢谢

推荐答案

回复很晚,但是...

Very late reply, but...

在您的代码中, frm_navigation.nav_organizations 需要指定NavigationSubForm子窗体控件的名称(默认情况下为NavigationSubForm)。

In your code, "frm_navigation.nav_organizations" needs to specify the name of the NavigationSubForm subform control (by default it is NavigationSubForm).

让我尝试使用通用名称重新声明您的命令:

Let me try to re-state your command with generic names:

DoCmd.BrowseTo acBrowseToForm, "frmToDisplayInNavSubCtl", "frmMainFormContainingNavSubFrmCtl.NavSubFrmCtl", ....criteria....

因此,简而言之,您需要进入frm_navigation表单的设计视图,并确定NavigationSubForm控件的名称,而不是导航按钮的名称(例如nav_organizations,nav_vacancies等),然后使用该名称。点之后,而不是.nav_organizations(按钮控件的名称)。

So, in short, you need to go into design view on your frm_navigation form and determine the name of the NavigationSubForm control, not the names of the navigation buttons (e.g., nav_organizations, nav_vacancies, etc.) and use that after the dot, instead of .nav_organizations (the name of the button control).

这篇关于如何在Access 2010中为BrowseTo指定PathToSubformControl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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