This is the first time i have tried to use the dlookup function. I have the following code. The UnitRate and the TotalCostPerMile fields are formated for currency.The VehicleId and The UnitNumber are both formatted for text. I am getting a synyax error in string in query expression [DeliveryId] error. This has frustrated me for 2 days now. any help will be greatly appreciated.
Code:
Private Sub UnitNumber_Click()
UnitRate.Value = DLookup("TotalCostPerMile", "[Vehicle List]", "[VehicleId]=" & [UnitNumber] & "'")
End Sub