Emoncada
08-18-2008, 06:35 AM
I have 2 userforms that work with each other.
a cmdButton calls the other userform. What i want is for when the second form is closed to show userform1, but also be able to click the cmdbutton again to go back to userform2 if necessary and be able to close that one and go back to userform1.
Hope that's not that confusing.
I got this script that works nice from an earlier thread.
UserForm2
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
UserForm1.Show
End If
End Sub
Problem is if I click on the CmdButton on UserForm1 to call This userform2 it gives me
RUN-TIME ERROR '400'
FORM ALREADY DISPLAYED; CANT SHOW MODALLY
Can someone help.
Thanks
a cmdButton calls the other userform. What i want is for when the second form is closed to show userform1, but also be able to click the cmdbutton again to go back to userform2 if necessary and be able to close that one and go back to userform1.
Hope that's not that confusing.
I got this script that works nice from an earlier thread.
UserForm2
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
UserForm1.Show
End If
End Sub
Problem is if I click on the CmdButton on UserForm1 to call This userform2 it gives me
RUN-TIME ERROR '400'
FORM ALREADY DISPLAYED; CANT SHOW MODALLY
Can someone help.
Thanks