@Neopa
I agree completely with your views on DLookup, but I have used it, albeit reluctantly, when the joins make a query not updateable.
@swahaba
Firstly Neopa's advice is very sound, but if you do have to use DLookup then what is 18280?
The normal DLookup syntax is
-
HostAmount: DLookUp("Amount","tblCardHost","AuthorisationCode = " & MyField)
-
Where MyField is numeric or
-
HostAmount: DLookUp("Amount","tblCardHost","AuthorisationCode = " & Chr$(34) & MyField & Chr$(34))
-
Where MyField is Text
There are alternatives to using Chr$(34), but the look messy (depending on the font.
-
HostAmount: DLookUp("Amount","tblCardHost","AuthorisationCode = '" & MyField & "'")
-
Phil