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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide Controls Based on Check Box

Status
Not open for further replies.

mcongdon

Programmer
Mar 14, 2008
98
US
This seems like it should be simple. I probably am neglecting to see something obvious, but I would like to have a checkbox that when checked will reveal controls. When unchecked, the controls disappear. I can't figure out what the VBA would be and I can't see any way to do it with Access 2000's macros. Any help would once again be greatly appreciated!
 
AfterUpdate of the checkbox:

If Me.CheckboxName Then
Me.ControlName.Visible = True
Else
Me.ControlName.Visible = False
End If

Let them hate - so long as they fear... Lucius Accius
 
How are ya mcongdon . . .

Put a question mark [blue]?[/blue] (no quotations please) in the [blue]Tag[/blue] property of each control of interest. Then in the [blue]AfterUpdate[/blue] event of the checkbox, copy/paste the following:
Code:
[blue]   Dim ctl As Control
   
   For Each ctl In Me.Controls
      If ctl.Tag = "?" Then ctl = Me![purple][b][i]CheckboxName[/i][/b][/purple]
   Next[/blue]
[blue]Your Thoughts? . . .[/blue]

Calvin.gif
See Ya! . . . . . .

Be sure to see thread181-473997
Also faq181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top