How do I hide a sub form? I have a cmd button on my main form which takes me to the sub form. I would like the main form to hide once the sub form is oppened. I tried Me.Hide and that is not working. Any suggestions?
In Access the subform is considered to be a control on the main form. So, if you are in the subform, you can't hide the main form because it still has the focus. What are you trying to accomplish, there may be another way to do it.
Actually, this isn't a sub form. The focus is opening a new form. For example: my open form button on the switchboard opens the new form, but I would like the switchboard to close once the new form is open.
Thank you.
Try using Me.Visible = False Remember though.. the form is still in memory. You can unhide it using the menu (Window/Unhide), by referencing it by name (formName.Visible = True) or by re-opening the form. You need to remember that the forms load event will not be processed when it is Re-opened from the hidden state. This may or may not be a problem, depending on your form.
To completely unload a form, I usually use the DoCmd.Close. This method doesn't work to well though if you are doing something with another form at the same time. -Dustin
Rom 8:28
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.