Link to home
Start Free TrialLog in
Avatar of zero118
zero118

asked on

Show/Hide Specific Tabs on Record Change

I have a form using Tabs.  I know how to allow a specific tab to only show when the value of a combo is correct, but I can't get it to auto-update when moving through current records.  Everytime a already-entered record is on the screen I need it to check pmStyle.  
If it's "A" then
Me.TabA.Visible = True
Me.TabB.Visible = False
If it's "B" then
Me.TabA.Visible = False
Me.TabB.Visible = True

Like I said, I can do this with a combo and I can do it onFormLoad but only for the first record that shows then it stays the same.  How I can take that same code and run it every time you flips to a different record?
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Your question has appeared in the Microsoft Word area, but tabs and the onFormLoad event are unfamiliar in Word VBA forms. Is it in some other environment?

That being said, it sounds as if you should call your code from the Click or Change event of the combo.

Sub Combo1_Change()
if Combo1.text = "A" then
'...
Avatar of zero118
zero118

ASKER

***Can a Mod move this to Access Please?***
That's what I'm doing right now but it doesn't help because I need it to check this condition as soon as each new record loads into the form when moving through them.
ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

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