Tab control to open when record selected

P

pkeegs

I have a client detail form with a tab control with five pages for different
locations. Each page has additional information relating to the clients
location which I currently access by clicking on the control name. I have a
field in the main form for location. Once I set the location is it possible
to automatically open the correct tab on the control so that I can scroll
through the form records and see the additional information without having to
click on the Tab name?
 
S

Stefan Hoffmann

hi,
Once I set the location is it possible
to automatically open the correct tab on the control so that I can scroll
through the form records and see the additional information without having to
click on the Tab name?
Sure. Set the TabControl.Value to the index of your page, e.g. 1 for the
second page.


mfG
--> stefan <--
 
R

RonaldoOneNil

In the after update event of the Location field set the focust to the tab
name within your tab control and then set focus to the next control on your
main form

Private Sub cmbCustSelect_AfterUpdate()
Me.YourTabName.SetFocus
Me.YourNextMainControl.SetFocus
End Sub
 
P

pkeegs

I suspect I have to have a condition in there somewhere. The client details
have a location "Area1", "Area2" etc. What I want to do is when a client in
Area1 is selected, the tab control will open at additional information on
Area1 and likewise when a client in Area2 is selected the tab with additional
information for Area2 will open. The code you have provided works well and I
see how to use it with AfterUpdate and have also used it with OnEntry to
achieve the same effect, but it only opens the one tab. Any solutions?
 

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