Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tab contorls visible based on checkbox

Status
Not open for further replies.

ArffMarine

Technical User
Jan 20, 2004
23
0
0
US
I have a form with three tab controls. I want the third tab to be visible only if a box is checked on the first tab. The check box is checked if a student is assigned to a physical fitness program. The third tab contains the information on the fitness program. If the student is not on the fitness program, the tab is not needed so I would like the tab to be hidden. I know i need to build an event in the after update area but do not know the code.
 
Arf

Use the check box's 'On Click' event

Forms!FormName!TabName.visible = true

You will need to set the tab's visible property beforehand to false. You will also need to determine where and when you wish the tab to again become invisible.

In general though, use disappearing controls sparingly. You will find that it tends to confuse users.

Cheers,
Bill
 
I tried but i keep getting an error message. If it helps, the form name is "Student Information" and the tab is named "Firefighter PT Program".

By the way, where in TX are you from? I live in San Angelo.
 
Arf, you have three Tab controls or a TabControl with three pages ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
PH,

I have a form, "Student Information", with three tab controls titled "Student Information", "Failures", and "Firefighter PT Program". The "Firefighter PT Program" tab is the one i want to not be visible unless the "Assigned to Firefighter PT Program" check box is checked. The tab # for the PT tab is 2.
 
I tried but i keep getting an error message
Any chance you could post the whole error message and the highighted code when in the debugger ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
Error Message:

The expression On Click you entered as the event property settin produced the following error: A problem occured while Microsoft Access was communicating with the OLE server or ActiveX Control.

*The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure].

*There may have been a error evaluating the function, event, or macro

------------------------------------------------------------

There is no debugger button for me to click.

Here is the code string from VB

Private Sub Assigned_to_Firefighter_PT_Program_Click()
Forms!Student_information!Firefighter_PT_Program.Visible = True
End Sub
 
I've heard of some problem with OLE in Access when Norton AntiVirus script blocking is on.

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
I read up on the Microsoft website about the OLE problems. I tried disabling script blocking and disableing the Norton Office Plugin but to no avail. i think te best thing to do is abandon the idea.
 
I finally got this working but had to rebuild the database. I can send anyone who is interested the VB Script I used. Thank you for your help FormerTexan. I had to tweak what you posted but was able to get there.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top