Hiding tabs?

JPritch

Registered User.
Local time
Today, 10:45
Joined
Jan 7, 2005
Messages
54
I have created a form with an option group containing seven options. I have linked each option to a tab. Thanks to the help of people on this board showing me how to code visible/non-visible, I was able to write logic that hides all tabs except for the option selection:

Private Sub AwardOption_AfterUpdate()
If Me.AwardOption = 1 Then
Me.Heart.Visible = True
Else
Me.Heart.Visible = False
End If

If Me.AwardOption = 2 Then
Me.Ingenuity.Visible = True
Else
Me.Ingenuity.Visible = False
End If

If Me.AwardOption = 3 Then
Me.Clarity.Visible = True
Else
Me.Clarity.Visible = False
End If

...and so on for options 4-7....

My problem is that when you open the form, a random option is selected but all tabs are still visible. It is only when you actually click another option that the rest of the tabs hide. How do I set the form so that when the form opens, no tabs are visible or ideally to set option 1 as default and show its corresponding tab, with the rest of the tabs hidden until their option is selected?

Much thanks for all replies!!!
 
Last edited:
I don't think I have ever hidden tabs, but can you just set them to hidden in design view?

kh
 
I don't know if they can be hidden in design view or not.

I think this requires a VBA solution, IMO.

I know the hiding of tabs might be counterintuitive, but I wanted to avoid the clutter of 7 tabs on my form. I actually wanted to avoid using tabs altogether and just have invisible portions of the form become visible when an option was selected, but I didn't know how to do that, so I went with a tab design.
 
Sounds like you've got it working, but need to put some code in the "Open Form" event to reference this.
 
DocNice...can you get me started on what to put in the Open Form Event? I tried some things, but can't get anything to work.

Basically, I want the form to open with option 1 and it's corresponding tab visible.
 
Set the tabs to none on the forms property sheet then use the set focus method to move to whichever page you want
 
I got it to work. Don't know if the code was the most efficient ever, but I have the form doing what I want it to do!

Thanks a bunch to all of you again!
 
JPritch,

Just in case you run into similar issues in future.
Your code would have worked if you would have put exactly the same code in the On Current event of your form.

So, that is:

- in the After Update event of the control on your form AND
- in the On Current event of your form

RV
 

Users who are viewing this thread

Back
Top Bottom