access 2010 run time error message 3464 -


i trying use combo box field called cboyearqtr retrieve info , return data on selection on form. data mismatch run time error 3464. date_yyyyqx field text field , calling myyearqtr string in code. not understand why throws error here. think should work. have looked on site , else , looks correct me.

code:

private sub cboyearqtr_afterupdate()  dim myyearqtr string  myyearqtr = "select distinct date_yyyyqx [tbl_yyyyqx_lu] [date_yyyyqx] = " & me.cboyearqtr & "" [forms]![frm_tbl_drug_master_date_lu].form.recordsource = myyearqtr [forms]![frm_tbl_drug_master_date_lu].form.requery   end sub 

thanks help!

when building text strings run sql need place ' around variable.

myyearqtr = "select distinct date_yyyyqx [tbl_yyyyqx_lu] [date_yyyyqx] = '" & me.cboyearqtr & "'" 

Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -