Cannot Get DLookup Function to work in Access 2013 -
i trying dlookup function work in access 2013, cannot work, heres have far :-
i have query called qry_vehicleoverview
in query there 2 fields called vehiclenumber
, datelastexam
i have form, there number of fields, 2 of them called vehicle1
, datelastexamv1
, in datelastexam1
! trying reference relevant exam based on vehicle1
qry_vehicleoverview
field, when vehicle number added vehicle1
displays correct exam in datelastexam1
first of create combo box in form, called vehicle1
, referenced vehiclenumber
qry_vehicleoverview
then created text box in form, , called lastexamvehicle1
, in control source of field added dlookup function :-
=dlookup("[datelastexam]","qry_vehicleoverview","[vehiclenumber]=""" & [vehicle1].[text] & """")
then chose after update
in event
tab , selected code builder
in here added :-
private sub lastexamvehicle1_afterupdate() me.lastexamvehicle1.requery end sub
but when run form, first of error of #type in field, when change value in vehicle1
eror changes #error
i create combo box in form, called vehicle1 , referenced vehiclenumber qry_vehicleoverview
if so, there no need dlookup have value.
set rowsource of vehicle1 qry_vehicleoverview , count of fields combobox 2 , use controlsource textbox:
=[vehicle1].[column](1)
it automatically update.
Comments
Post a Comment