Link to home
Start Free TrialLog in
Avatar of ny971181
ny971181

asked on

open up the form with correct tab

hi,
Here is my problem:
in form1
Private Sub form_load(0
     sstab.tab = 0
end sub

in form2
Private Sub cmd1_click()
     load form1
end sub

Now when I click cmd1, it will load form1, but with tab 0. where should I code to open the form with tab1 without changing the line sstab.tab = 0?

sstab.tab = 0 in form_load can't be changed because in most cases, the form will be opened with tab 0. And in some other cases, It need to be opened with tab 1. That is my real question..

thank you

:)
ny971181
ASKER CERTIFIED SOLUTION
Avatar of clifABB
clifABB

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of dgb001
dgb001

You could just create a global variable (ie. declare it in a .bas module as somthing like OPENTAB) and then just set it as required. On form load then just :

Private Sub Form_Load()
  ssTab.Tab = OPENTAB  'which would be set on cmd_click to 1
  OPENTAB = 0          'reset to default
End Sub