T
TMC
Hello:
I am having a problem with the syntax for dlookup.
I am trying to find the TARE (empty) weight of a vehicle in a table called
TBL_MSW_VEHICLE by searching on the ACCT_NUM and VEH_ID.
TBL_MSW_VEHICLE Fields:
ACCT_NUM - Number
VEH_ID - Text
TARE - Number
FORM:
CMBO_ACCOUNT - Account combo box in form
CMBO_VEHICLE - Vehicle combo box in form
FLD_TARE - Vehicle empty weight in form
CODE:
Fld_Tare = DLookup("[tare]", "[tbl_Msw_Vehicle]", "[acct_num] =" &
[Cmbo_Account] & " And [VEH_ID] = " & [cmbo_vehicle])
The code works in this format if I search only by Vehicle or by Account but
when I merge the code together with the AND statement I get the error:
Run-Time error '3464':
Data type mismatch in criteria expression
This whole & "" ' syntax totally confuses me.
Any help would be greatly appreciated. Also is there a location (Ie.
sight/doc) that gives a reasonable explanation on this syntax.
Thanks
TMC
I am having a problem with the syntax for dlookup.
I am trying to find the TARE (empty) weight of a vehicle in a table called
TBL_MSW_VEHICLE by searching on the ACCT_NUM and VEH_ID.
TBL_MSW_VEHICLE Fields:
ACCT_NUM - Number
VEH_ID - Text
TARE - Number
FORM:
CMBO_ACCOUNT - Account combo box in form
CMBO_VEHICLE - Vehicle combo box in form
FLD_TARE - Vehicle empty weight in form
CODE:
Fld_Tare = DLookup("[tare]", "[tbl_Msw_Vehicle]", "[acct_num] =" &
[Cmbo_Account] & " And [VEH_ID] = " & [cmbo_vehicle])
The code works in this format if I search only by Vehicle or by Account but
when I merge the code together with the AND statement I get the error:
Run-Time error '3464':
Data type mismatch in criteria expression
This whole & "" ' syntax totally confuses me.
Any help would be greatly appreciated. Also is there a location (Ie.
sight/doc) that gives a reasonable explanation on this syntax.
Thanks
TMC