Hi there,
I am trying to populate automatically controls with city, zip, address, etc. data based on a control that contains the name of a store. I cut and paste the afterupdate event from the Norhtwind database and here is what I have:
Private Sub Name_AfterUpdate()
On Error GoTo Err_Name_AfterUpdate
Dim strFilter As String
' Evaluate filter before it's passed to DLookup function.
strFilter = "Name = " & Me!Name
' Look up product's unit price and assign it to UnitPrice control.
Me!City = DLookup("City", "StoreName", strFilter)
Exit_Name_AfterUpdate:
Exit Sub
Err_Name_AfterUpdate:
MsgBox Err.Description
Resume Exit_Name_AfterUpdate
End Sub
The error I have when I run this is:
Syntax Error (missing operator) in query expression 'Name=(Name of the store)'
Any idea of what's going on here?
Thanks,
Luke
I am trying to populate automatically controls with city, zip, address, etc. data based on a control that contains the name of a store. I cut and paste the afterupdate event from the Norhtwind database and here is what I have:
Private Sub Name_AfterUpdate()
On Error GoTo Err_Name_AfterUpdate
Dim strFilter As String
' Evaluate filter before it's passed to DLookup function.
strFilter = "Name = " & Me!Name
' Look up product's unit price and assign it to UnitPrice control.
Me!City = DLookup("City", "StoreName", strFilter)
Exit_Name_AfterUpdate:
Exit Sub
Err_Name_AfterUpdate:
MsgBox Err.Description
Resume Exit_Name_AfterUpdate
End Sub
The error I have when I run this is:
Syntax Error (missing operator) in query expression 'Name=(Name of the store)'
Any idea of what's going on here?
Thanks,
Luke