Access Can't Get Dlookup To Work

Joined
Jul 6, 2017
Messages
2
Reaction score
0
Private Sub CalcBtn_Click()
Dim fromLocation As String
Dim toLocation As String
Dim search As String
If Me.LiqourFrom = True Then
search = "Liqour"
fromLocation = DLookup("Address", "Places", "Location = '" & search & "'")
MsgBox ("Nice")
End If
End Sub


Everything I have seen tells me to lookup like this. However I still get error '2471':
The expression you entered as a query parameter produced this error: 'Location'
 
Joined
Jul 6, 2017
Messages
2
Reaction score
0
Private Sub CalcBtn_Click()
Dim fromLocation As String
Dim toLocation As String
Dim search As String
If Me.LiqourFrom = True Then
search = "Liqour"
fromLocation = DLookup("Address", "Places", "Location = '" & search & "'")
MsgBox ("Nice")
End If
End Sub


Everything I have seen tells me to lookup like this. However I still get error '2471':
The expression you entered as a query parameter produced this error: 'Location'
=-=-=-=-=-=-=-=-=-=--=
edit
nvm im dumb
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top