G
Guest
In ACCESS 2002 I used the following code to make form1
visible when you click the command button on form2, and
then to make form2 visible when you click on form1. I
got an error message stating that "type-declaration
character does not match declared data type."
specifically relating to "Forms!"
following is the coding:
Private Sub cmdOpen1_Click() --on main form
Me.Visible = False
DoCmd.OpenForm "Form2"
End Sub
----------------
'in second form:
Private Sub Form_Unload(Cancel as Integer)
Forms!Form1.Visible = True
End Sub
---------------------------
'in main form
Private Sub cmdOpen_Click()
Me.Vislble = False
DoCmd.OpenForm "Form2", OpenArgs:=Me.Name
End Sub
--------------
'in second form
Private Sub Form_Unload(Cancel as Integer)
Forms(Me.OpenArgs).Visible = True <---the trouble "Forms"
End Sub
Why? How to correct??? Is this an error in the program?
I tried putting a "Dim Form1, Form2 as Object" Didn't
help.
visible when you click the command button on form2, and
then to make form2 visible when you click on form1. I
got an error message stating that "type-declaration
character does not match declared data type."
specifically relating to "Forms!"
following is the coding:
Private Sub cmdOpen1_Click() --on main form
Me.Visible = False
DoCmd.OpenForm "Form2"
End Sub
----------------
'in second form:
Private Sub Form_Unload(Cancel as Integer)
Forms!Form1.Visible = True
End Sub
---------------------------
'in main form
Private Sub cmdOpen_Click()
Me.Vislble = False
DoCmd.OpenForm "Form2", OpenArgs:=Me.Name
End Sub
--------------
'in second form
Private Sub Form_Unload(Cancel as Integer)
Forms(Me.OpenArgs).Visible = True <---the trouble "Forms"
End Sub
Why? How to correct??? Is this an error in the program?
I tried putting a "Dim Form1, Form2 as Object" Didn't
help.