Example of Hiding or UnHiding a Form

  • Thread starter Thread starter SureFireSolutions.com Inc.
  • Start date Start date
S

SureFireSolutions.com Inc.

Hello, I'm using Access 2000.

Does anyone have an example of how to hide or unhide a form programmatically
?

Don @ SureFireSolutions
 
To hide or unhide a form, it must be open or use the Window Mode argument in
the DoCmd.OpenForm call to open it hidden.

Examples:
Me.Visible = False
Me.Visible = True

Forms!Form1.Visible = False
Forms!Form1.Visible = True

DoCmd.OpenForm "Form1",,,,,acHidden
 
Thanks Wayne !

Will I'm thinking of it would you have an example of the Show or Hide method
?
I'm finding this example confusing...when I tried replacing UserForm1 with
the name of the form it wouldn't work for me ?

************
' This is the Initialize event procedure for UserForm1
Private Sub UserForm_Initialize()
Load UserForm2
UserForm2.Show
End Sub
' This is the Click event of UserForm2
Private Sub UserForm_Click()
UserForm2.Hide
End Sub

' This is the click event for UserForm1
Private Sub UserForm_Click()
UserForm2.Show
End Sub
************

Don @ SureFireSolutions

P.S. I've got my original problem resolved and working fine by using your
suggestion of Forms!frmMyFormName.Visible = false, etc. but I'm continuing
with my now life long journey of learning more about Access.
 
The syntax you've displayed is VB, not VBA in Access. My previous posts
included the examples for Access.
 
PS.

The main difference between VB and VBA is that VBA has to be used in
conjunction with the object model for the application (in this case, Access)
that you are using the VBA in. The code you listed is for VB forms, not
Access forms.
 

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

Back
Top