G
Guest
I am trying to run the following
Private Sub Cartage_GotFocus()
Result = DLookup("Cost", "Cartage", "ClientID = '" & Forms!Order!ClientID &
"'_ And StoreID = '" & Forms!Order!OrderDetail!StoreID & "'")
Cartage.Value = Result
End Sub
I Keep getting Data Type Mismatch. When in the DeBug window with the cursor
over the string it shows the correct value.
When I hard code
Result = DLookup("Cost", "Cartage", "StoreID = 3") or
Result = DLookup("Cost", "Cartage", "ClientID = 5") I get the right "Cost"
and I can enter the cost in manually in the form.
It seems to be when I add the & Forms! etc that it rejects.
Am not sure where to look now.
Help appreciated and thank you in advance
Private Sub Cartage_GotFocus()
Result = DLookup("Cost", "Cartage", "ClientID = '" & Forms!Order!ClientID &
"'_ And StoreID = '" & Forms!Order!OrderDetail!StoreID & "'")
Cartage.Value = Result
End Sub
I Keep getting Data Type Mismatch. When in the DeBug window with the cursor
over the string it shows the correct value.
When I hard code
Result = DLookup("Cost", "Cartage", "StoreID = 3") or
Result = DLookup("Cost", "Cartage", "ClientID = 5") I get the right "Cost"
and I can enter the cost in manually in the form.
It seems to be when I add the & Forms! etc that it rejects.
Am not sure where to look now.
Help appreciated and thank you in advance