导航到不同的选项卡导航子窗体 [英] navigating to a different tab in navigation subform
问题描述
在一个MS Access 2010数据库,我有一个列表框的更新后的程序需要(其中包括)导航到导航子窗体的特定标签。我可以得到它改变导航子窗体的SourceObject属性,但所选择的选项卡不得到改变,因此用户最终看到的与错误选项卡中选择了正确的源对象。这看起来不专业。我如何可以更改所选标签和源对象?
In an ms access 2010 database, I have a listbox whose afterupdate procedure needs (among other things) to navigate to a specific tab in a navigation subform. I can get it to change the SourceObject property of the navigation subform, but the selected tab does not get changed, so the user ends up seeing the right source object with the wrong tab selected. This looks unprofessional. How can I change both the selected tab and the source object?
我上传,再现问题此文件共享网站简化数据库。
I uploaded a simplified database that recreates the problem to this file sharing site.
这需要其更新后的方法列表框改称为 lstbxClients
。这是我目前其更新后的方法,这是目前引发错误的草案:
The list box that needs its afterupdate method changed is called lstbxClients
. Here is my current draft of its afterupdate method, which is currently throwing an error:
Private Sub lstbxClients_AfterUpdate()
Dim rst
Set rst = Me.RecordsetClone
rst.FindFirst "ClientNumber = " & lstbxClients.Column(0)
Me.Bookmark = rst.Bookmark
'Forms!Main!NavigationSubform.Form!NavigationSubform.SourceObject = "qryListCommunicationForms"
DoCmd.BrowseTo acBrowseToForm, "qryListCommunicationForms", "Forms!Main!NavigationSubform.Form!NavigationSubform"
Form.NavigationSubform " "
'Forms!Main!NavigationSubform.Form!NavigationSubform.SelectedTab = "CommFormsNavBtn"
Set rst = Nothing
End Sub
我要如何改变code以上,使其变为两个所选选项卡和导航子窗体的源对象,当用户单击列表框不同的记录?
How do I change the code above so that it changes both the selected tab AND the source object of the navigation subform when the user clicks on a different record in the listbox?
推荐答案
访问了什么样的路径的正确语法是一个比较体面的解释。
Access gave a relatively decent explanation of what the proper syntax of the path is.
所以,你BrowseTo命令应该是这样的:
So your BrowseTo command should look like this:
DoCmd.BrowseTo acBrowseToForm,qryListCommunicationForms,Main.NavigationSubform> FindClientsNavigation.NavigationSubform
这篇关于导航到不同的选项卡导航子窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!