S
Sam Kuo
Hi,
I have the following code that opens the password-protected form2. But I
also would like to have form 1 closed IF form2 is opened. Could anyone please
show me how this can be done? Any help much appreciated.
Private Sub Form_Open(Cancel As Integer)
Const strFormPassword As String = "password"
If InputBox("Please enter password") <> strFormPassword Then
MsgBox "Password incorrect. Please try again", vbOKOnly
Cancel = True
End If
End Sub
I have the following code that opens the password-protected form2. But I
also would like to have form 1 closed IF form2 is opened. Could anyone please
show me how this can be done? Any help much appreciated.
Private Sub Form_Open(Cancel As Integer)
Const strFormPassword As String = "password"
If InputBox("Please enter password") <> strFormPassword Then
MsgBox "Password incorrect. Please try again", vbOKOnly
Cancel = True
End If
End Sub