Hi,
Having a problem finding the right syntax for using numerical variables with DLookup. The code I have written, which is throwing up an error 'lngNo', is this:
lngID = DLookup("CustID", "tblInvoice", "[BookingID] = lngNo")
lngNo is a long varible, as each time the code is run, the value is likely to be different. If I hard code it thus:
lngID = DLookup("CustID", "tblInvoice", "[BookingID] = 7")
then it works fine, but is useless to me. I'm missing something simple here, I know, but at present it's eluding me.