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'
 
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
 
Back
Top