Form.visible = false

Skip Bisconer

Who Me?
Local time
Today, 01:20
Joined
Jan 22, 2008
Messages
285
I have a form that opens another form and sets the first form visable property to false. When I am done with the second form I would like to get the first one visible again. Right now it doesn't come back. If I make an open form docmd on the close of the second one much of the data has to be reintered on the first form.

So my question is...how do I make the first form visable again when the second one closes? Is there a better way to make this happen? Thanks for looking at my problem.
 
Make the 1st form invisible *before* you open the 2nd form and then use the acDialog argument to stop the code in the 1st form. Then the lone after the OpenForm can make the 1st form visible again.
 
Thanks RG for responding.
I looked up the acdialog in help and tried the following code but it in this format when it gets to the docmd.open it opens a window to select a macro. So I tried putting quotes around the name and it tells me I have no form with this name. As I copied pasted the name into the code I know the spelling is correct. Below is my code:

Private Sub Command31_Click()
Me.Visible = False
DoCmd.OpenForm FormName:=frmLateOrdersAdd, WindowMode:=acDialog
Me.Visible = True
End Sub

I changed the form to open to Modal Yes.
 
How about:
Code:
Private Sub Command31_Click()
   Me.Visible = False
   DoCmd.OpenForm "frmLateOrdersAdd", , , , , acDialog
   Me.Visible = True 
End Sub
 
It might have also worked by using parens on the 1st argument.
DoCmd.OpenForm FormName:="frmLateOrdersAdd", WindowMode:=acDialog
...but I wasn't sure. Glad I could help.
 

Users who are viewing this thread

Back
Top Bottom