access vba - DLookup 3075 Missing Operator Around NZ? -
this code: private sub form_current() set rs = currentdb.openrecordset("sites", dbopendynaset, dbseechanges) rs.requery rs.movefirst if nz(me.site_id.value) > 0 me.h2obillingidlbl.caption = dlookup("h2obillingidnum", "sites", "h2obillingidnum = " & me.txthotelid) else me.h2obillingidlbl.caption = "" end if end sub the dlookup line throwing error. me.txthotelid box text entry box on form , used enter numbers only. the h2obillingidnum field in recordset long. i have tried putting brackets around h2obillingidnum ; .value @ end of h2obillingidnum , me.txthotelid alternatively , combined; entering data string in case data mismatch error. i don't believe can use sql query because text entry field, if i'm wrong, i'll happily take information i've never heard of sql query , it's faster , more accurate method of pulling data. i'm out of ideas. suggestions? nz? there bet...