Open Subform with Button

denileigh

Registered User.
Local time
Today, 12:45
Joined
Dec 9, 2003
Messages
212
Hello all,

I know I have seen this before and I have searched the forums several times and cannot find it now.

Maybe I am searching the wrong thing. Can someone point me in the right direction?

I need a button on my form that opens a subform or subforms when clicked.

How do I set this up?

Thanks,
Di
 
denileigh, the easiest solution is to make sure the toolbox wizard is on while putting the button onto your main form. it will pop up with a number of options, one of them being opening other forms.

Once this is done, you can go into the VB editor for that form and copy the code to open other forms if you want.;)
 
Thanks! I know how to use the wizard. I'm sorry, I probably didn't explain myself.

I want the subform to be hidden unless a button is clicked that makes it appear.

Thanks
 
Me.SubFormControlName.Visible = True
 
Oh I see

Try this code then in the click event of the button:

Code:
If fsub1.Visible = False Then
fsub1.Visible = True
Else: fsub1.Visible = False
End If

Just substitute the "fsub1" for the name of your subform.:D
 

Users who are viewing this thread

Back
Top Bottom