开发者

Go To Record + Specific Tab

开发者 https://www.devze.com 2023-03-14 20:53 出处:网络
I have created a search criteria form that allows the user to search for specific branches that our company deals with. Now - I have created a button that displays with each entry found by the search.

I have created a search criteria form that allows the user to search for specific branches that our company deals with. Now - I have created a button that displays with each entry found by the search.

I want this button to open to the specific 'ID' that goes with each record, but here is my problem: this search criteria form (Tab1) updates the records information (Tab2,Tab3,Tab4) But doesnt jump to the tab after being pressed - Simply because I'm not sure how to code it so that it automatically jumps to Tab2 (the first tab of data).

Here is my code below:

Module1

Public Function viewDetails(frmID As Integer)

Dim rs As Object

DoCmd.OpenForm "Form1"

'Directs to the selected record
Set rs = Forms!Form1.RecordsetClone
rs.FindFirs开发者_StackOverflow中文版t "ID = " & frmID
Forms!Form1.Bookmark = rs.Bookmark

Set rs = Nothing

and

Private Sub Command46_Click()

    viewDetails (Me.ID)

End Sub

Thanks :)


The .Value property of the TabControl is a read/write property that you can use to get the currently selected page or set the currently displayed page. It is the default property of the tab control so you do not need to explicitly refer to it. Note that the page index is a zero-based array so the second tab is 1 in the index:

Forms!Form1.TabCtl0 = 1  'Jump to the second tab; form must already be open
0

精彩评论

暂无评论...
验证码 换一张
取 消