Getting RunTime Error 2001

bconner

Registered User.
Local time
Today, 08:25
Joined
Dec 22, 2008
Messages
183
I am trying to execute the code below and I keep getting a RunTime Error 2001 'You canceled previous operation'

When click debug it highlights the row: strLogin = Nz(DLookup("[QA LOGIN]", "Tbl_QA_Representatives", "[QA LOGIN]= " & Forms![FRM_LOGIN]![Login_txt_Id]), 0)


I have attached a copy of the database for review.


Code:
Private Sub Command10_Click()
Dim strLogin As String
Dim strPassword As String
 
'Use DLookup to pull Login Id and Password
strLogin = Nz(DLookup("[QA LOGIN]", "Tbl_QA_Representatives", "[QA LOGIN]= " & Forms![FRM_LOGIN]![Login_txt_Id]), 0)
strPassword = Nz(DLookup("[QA PASSWORD]", "Tbl_QA_Representatives", "[QA PASSWORD]= " & Forms![FRM_LOGIN]![Login_txt_Password]), 0)
 
 
'If Login doesn't return zero then open MainEntry form else MsgBox Login or Password invalid try again
If (strLogin <> 0 And strPassword <> 0) = vbTrue Then
DoCmd.OpenForm "Frm_MainEntry"
Else
MsgBox "Login or Password is invalid please try again"
 
End If
End Sub

Any help is greatly appreciated
 

Attachments

Thanks VbaInet that worked perfectly...
 

Users who are viewing this thread

Back
Top Bottom