Link to home
Start Free TrialLog in
Avatar of H-SC
H-SCFlag for United States of America

asked on

Event On Tab Click

I have a form that has a tab control on it that has four tabs.  One of the tabs has a subform on it and one field.  I would like for the following to occur when the user clicks on the 4th tab.

If the one field on the tab is not null then the subform should not be visible else the subform should be visible.  This works on non-tabed forms using the on current but I cant seem to get this to work on a form with tab ctl using the on tab click.
ASKER CERTIFIED SOLUTION
Avatar of puppydogbuddy
puppydogbuddy

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 puppydogbuddy
puppydogbuddy

PS: You have to replace the subform/field names I used with your own.  Also the dotted lines indicate optional code that you may want to add.
<One of the tabs has a subform on it and one field>  Do you mean the 4th tab has a subform and a control?
Avatar of H-SC

ASKER

GRayL,

Yes, only the fourth tab has everything that my question involves.  When the user clicks on that 4th tab then the event occurs (only on the items that pertain to that tab and that screen).

Avatar of H-SC

ASKER

puppydogbuddy,

I will try...I think that I would only need one section of your code...I would only want to apply this event on one tab/field
You definitely want the If Me.Dirty .....as the first line of your code in the tab control........it centrallly commits (saves) all changes that have occured on any of the individual tabs, reducing the code that has to be written for the individual tabs.  Also, if you only use case 4, be sure you have a case else so that you will be protected from the possibility of "fall thru" code.

                                        PDB  
oops! typo....the prior comment above should have referred to case 3 (for the 4th tab) not case 4.  Tab page indexes start with 0.