Hide Sub Forms until search Criteria is entered

G

Guest

How do you hide a subform on your form until you enter criteria using unbound
text boxes to filter the records?

I'd really appreicate any help that I can get here but I'm new to the Coding
side of Access so nothing too complicated please.
 
S

Scott McDaniel

How do you hide a subform on your form until you enter criteria using unbound
text boxes to filter the records?

You can set the .Visible property of your subform control to False when the main form opens:

Sub YourMainForm_Open(Cancel As Integer)
Me.NameOfYourSubformControl.Visible = False
End Sub

Now when you user initiates the search:

Me.NameOfYourSubformControl.Visible = True

However, I have to wonder about the wisdom of showing/hiding controls ... generally it's better to Enable/Disable them
unless they have no bearing on the current process, and that definitely doesn't appear to be the case here. Users tend
to get confused if a Button or Textbox magically appears, and then get frustrated when it goes away ... if you'd rather
Enable/Disable, just change .Visible to .Enabled.


Scott McDaniel
scott@takemeout_infotrakker.com
www.infotrakker.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top