Use DoCmd.GoToControl "Form name on tab control" on the AfterUpdate event
of the combo
Like this
Say you have a main form with 3 tabs .
On each tab is a form (form1 is on tab 1 - form 2 is on tab 2 and form 3 is
on tab 3)
On you main form create a combo (source = value list Form1;Form2;Form3) and
put this after update
Private Sub ComboName_AfterUpdate()
If Me.ComboName = "form1" Then
DoCmd.GoToControl "Form 1"
End If
If Me.ComboName = "form2" Then
DoCmd.GoToControl "Form 2"
End If
If Me.ComboName = "form3" Then
DoCmd.GoToControl "Form 3"
End If
End Sub
This said I think it would be much simpler to just click the tab ??
Use DoCmd.GoToControl "Form name on tab control" on the AfterUpdate event
of the combo
Like this
Say you have a main form with 3 tabs .
On each tab is a form (form1 is on tab 1 - form 2 is on tab 2 and form 3 is
on tab 3)
On you main form create a combo (source = value list Form1;Form2;Form3) and
put this after update
Private Sub ComboName_AfterUpdate()
If Me.ComboName = "form1" Then
DoCmd.GoToControl "Form 1"
End If
If Me.ComboName = "form2" Then
DoCmd.GoToControl "Form 2"
End If
If Me.ComboName = "form3" Then
DoCmd.GoToControl "Form 3"
End If
End Sub
This said I think it would be much simpler to just click the tab ??
Don't worry about speaking english well here - I am not english (I live here
now) and many people are here from all over the world. If you ask the basics
then an expert like a mvp may answer - if not then you may just get a normal
human (mvp is short for super-human) to try and help if possible.
quote "This said I think it would be much simpler to just click the tab ??"
I've made a tag for each item (i.e.). All the tabs have the same buttons and
the same format. I've removed the upper tag of each tag, too. When you select
an item from the combo, all the controls change seeming there is only a form.
Besides this way I avoid people change of tab before ending the task in this
item.
Very useful! ;-)
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.