Can anyone help with this small problem I am having when I open this form. I get an error message which says "The action or method requires a form name or argument" I have declared the form name but it is still not happy!
Private Sub commandStaffAddDetails_Click()
Dim username As String
Dim pwd As String
username = InputBox("Please enter your username ")
If username = "whatever" Then
pwd = InputBox("Please enter your password")
If pwd = "whatever" Then
DoCmd.OpenForm formStaffDetails, , True
Else
MsgBox "Username & password needed to view staff details form", vbCritical, "Restricted Area"
End If
End If
End Sub
any ideas?
Thanks
Private Sub commandStaffAddDetails_Click()
Dim username As String
Dim pwd As String
username = InputBox("Please enter your username ")
If username = "whatever" Then
pwd = InputBox("Please enter your password")
If pwd = "whatever" Then
DoCmd.OpenForm formStaffDetails, , True
Else
MsgBox "Username & password needed to view staff details form", vbCritical, "Restricted Area"
End If
End If
End Sub
any ideas?
Thanks