electricjelly
Registered User.
- Local time
- Today, 12:52
- Joined
- Apr 3, 2014
- Messages
- 26
Hello,
I am trying to use a dlookup to find information based on specific criteria but, every time I use it I receive an error "syntax error in date in query expression". however, I am not using any date format and I am confused as to why this is not working.
I am trying to use a dlookup to find information based on specific criteria but, every time I use it I receive an error "syntax error in date in query expression". however, I am not using any date format and I am confused as to why this is not working.
Code:
Private Sub Quick_Look_Click()
'On Error GoTo ErrorHandler
Dim Lookup As String
Dim Box As String
Dim LastName As String
Dim Address As String
Box = InputBox("Input cat's release number", "Release Lookup")
Lookup = DLookup("First", "QryQuickLookUp", "Release#=" & Box)
LastName = DLookup("Last", "QryQuickLookUp", "Release#=" & Box)
Address = DLookup("Address", "QryQuickLookUp", "Release#=" & Box)
MsgBox "FIRST NAME: " & Lookup & " LAST NAME: " & LastName & " ADDRESS: " & Address, vbOKOnly, "Quick Look UP"
GoTo Exitsub
ErrorHandler:
MsgBox "Sorry there is no record with that release #"
Exitsub:
End Sub