Hi
I need to construct a DLookup using two numeric fields and cannot get the syntax right. Sorry but could someone point me. I think I have just about tried every combination I can think of but I still cannot get it.
The code I currently have is
I tried separating the SQL off to a variable to see if I could get it to work that way but not sure if this is the best approach.
If you can help it would be much appreciated.
Thanks and best wishes
I need to construct a DLookup using two numeric fields and cannot get the syntax right. Sorry but could someone point me. I think I have just about tried every combination I can think of but I still cannot get it.
The code I currently have is
Code:
' Define variables
strSQL = "[lngConId] = " & Me.txtConId And [lngExp] = Me.cboExpType
' Verify that there is not already a relevant entry in tblExpenditure
varExp = DLookup("lngExpId", "tblExpenditure", "strSQL")
If you can help it would be much appreciated.
Thanks and best wishes