Detect which tab ...

S

SF

Hi I have an unbound form, a combobox and 3 subforms on 3 different tabs. I
have put the follwoing code attached to the combobox to refresh these
subform based on what has been selected in the combobox.

Private Sub cmbOrgID_AfterUpdate()
If Me.cmbOrgID = -1 Then
Me.frmProjectBrowserSubForm01.LinkChildFields = ""
Me.frmProjectBrowserSubForm01.LinkMasterFields = ""
Me.frmProjectBrowserSubForm04.LinkChildFields = ""
Me.frmProjectBrowserSubForm04.LinkMasterFields = ""
Me.frmProjectBrowserSubForm03.LinkChildFields = ""
Me.frmProjectBrowserSubForm03.LinkMasterFields = ""

Else
Me.frmProjectBrowserSubForm01.LinkChildFields = "TC_ContactID"
Me.frmProjectBrowserSubForm01.LinkMasterFields = "cmbOrgID"
Me.frmProjectBrowserSubForm04.LinkMasterFields = "cmbOrgID"
Me.frmProjectBrowserSubForm04.LinkChildFields = "TC_ContactID"
Me.frmProjectBrowserSubForm03.LinkMasterFields = "cmbOrgID"
Me.frmProjectBrowserSubForm03.LinkChildFields = "TC_ContactID"
End If
Me.frmProjectBrowserSubForm01.Requery
Me.frmProjectBrowserSubForm03.Requery
Me.frmProjectBrowserSubForm04.Requery

I plan to put a button to print the project list based on the current tab.
How do I detect which tab is the current position?

SF
 
B

Brendan Reynolds

How do I detect which tab is the current position?

The Value property of the tab control returns the zero-based index of the
current tab. That is, if the first tab is current, the Value property will
return 0, if the second tab is current, the Value property will return 1,
etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top