Simple VBA Question Here

ubeyou

New member
Local time
Yesterday, 19:05
Joined
Aug 17, 2008
Messages
8
My task is after i click the image button, it will auto redirect to another form, but that form contain 10 tabs, I want to redirect to 2nd tab, how should i do?

The Form name "Qa : Customer and Custodian same City" and the tabs name Qa~Qj

Thanks for helping.

Origin from here
Private Sub Image0_Click()
DoCmd.OpenForm "Qa : Customer and Custodian same City", acViewNormal
End Sub
 
Send the form and openarg with whatever the index value of the tab is and on open have it set focus to that tab (page index)

Something like:

Me.TabCtl0.Pages(me.openargs).SetFocus

In the on open event. Of course you have to do some logic if you want to open it where another tab has focus from another spot in your app.

Hope this helps. You may want to search for help on openargs.
 
Private Sub Image0_Click()
DoCmd.OpenForm "Qa : Customer and Custodian same City", acViewNormal
Me.TabCtl0.Pages(me.openargs).SetFocus
End Sub

Should I put like this? I think it doesn't work since "Me.TabCtl0.Pages(me.openargs).SetFocus" does not located in this form.

Just learnt Access, can provide more assistant? thanks
 

Users who are viewing this thread

Back
Top Bottom