go to tab

nattylou

New member
Local time
Today, 09:00
Joined
Sep 16, 2007
Messages
4
I have a form with many tabs, each tab with several fields (but no subforms). I want to set a macro so that after a certain event, one of the tabs will become active. I tried using gotopage, but the page number I set is not valid. Are tabs not considered pages? I also tried gotocontrol, but i have the same field located in more than one tab, so the proper tab is not becoming active?

is there a simple way to set gototab?

Thanks
 
Use the setfocus in the event:

Me.YourPageNameHere.SetFocus
 
Ok, but what if the event has some conditions attached. If "A" is selected then Tab A opens, but if "B" is selected, then Tab B opens?
 
I have a combo box as a field in TabA. Several values (B,C,D) as options. I have a TabB, TabC, and TabD. I want the correct tab to become active when a choice is made in the combo box. I am playing around with if thenif statements in Visual basic, but I am not very comfortable with it.
 
If the combo box's value is the ID number then you would do this in the Combo Box's AFTER UPDATE event:

Code:
Select Case Me.YourComboBoxNameHere

   Case 0
       ... put code for whatever to do when the first selection is made
   Case 1
      ... put code for whatever to do when the second selection is made, etc.
   Case ...
End Select

If the value is text then:
Code:
Select Case Me.YourComboBoxNameHere

   Case "Whatever Value Here"
       ... put code for whatever to do when the first selection is made
   Case "Whatever Other Value Here"
      ... put code for whatever to do when the second selection is made, etc.
   Case (etc.)...
End Select
 

Users who are viewing this thread

Back
Top Bottom