S
Sam Kuo
I was given the code below used to restrict user's entry to Form2, and to
close Form1 if correct password is entered. But now instead of close Form1,
I'd like to just hide it (so the user can get back to Form1 at its original
state after closing Form2).
I'm a newbie to Access coding. Could someone please show me how to amend the
code so it does just that? Thanks
--------------------------------------------------------
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
Else
DoCmd.Close acForm, "frmNameOfForm1", acSaveNo
End If
End Sub
close Form1 if correct password is entered. But now instead of close Form1,
I'd like to just hide it (so the user can get back to Form1 at its original
state after closing Form2).
I'm a newbie to Access coding. Could someone please show me how to amend the
code so it does just that? Thanks
--------------------------------------------------------
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
Else
DoCmd.Close acForm, "frmNameOfForm1", acSaveNo
End If
End Sub