G
Guest
I have used a button to switch to another form called "Mantain". I wanted to
password protect the form. I have a table called "Passwords" containing the
passwords for the users. This is my code for the button:-
Private Sub Maintenance_Click()
On Error GoTo Err_Maintenance_Click
Dim stDocName As String, inpass As String, stLinkCriteria As String
Dim passcheck As String
stDocName = "Maintain"
inpass = InputBox("Enter Password")
passcheck = DLookup("[Password]", "Passwords", "[PassLookup] = " & inpass)
If passcheck = Null Then
MsgBox ("Wrong Password")
GoTo Exit_Maintenance_Click
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Exit_Maintenance_Click:
Exit Sub
Err_Maintenance_Click:
MsgBox Err.Description
Resume Exit_Maintenance_Click
End Sub
When I run the sub routine I get a message "You cancelled the previous
operation"
I have not the slightest idea what this means. Can anyone help me please?
password protect the form. I have a table called "Passwords" containing the
passwords for the users. This is my code for the button:-
Private Sub Maintenance_Click()
On Error GoTo Err_Maintenance_Click
Dim stDocName As String, inpass As String, stLinkCriteria As String
Dim passcheck As String
stDocName = "Maintain"
inpass = InputBox("Enter Password")
passcheck = DLookup("[Password]", "Passwords", "[PassLookup] = " & inpass)
If passcheck = Null Then
MsgBox ("Wrong Password")
GoTo Exit_Maintenance_Click
Else
DoCmd.OpenForm stDocName, , , stLinkCriteria
End If
Exit_Maintenance_Click:
Exit Sub
Err_Maintenance_Click:
MsgBox Err.Description
Resume Exit_Maintenance_Click
End Sub
When I run the sub routine I get a message "You cancelled the previous
operation"
I have not the slightest idea what this means. Can anyone help me please?