Problem with DLookup

aadebayo

Registered User.
Local time
Today, 22:45
Joined
May 10, 2004
Messages
43
Hello
Please can someone tell me what is wrong with this code.

Dim intApplicant As Integer

intApplicant = DLookup("[ApplicantID]", "tblMedicalClearance", "[ApplicantID] = " & Me.ApplicantID & " And [PostNumber] = " & Me.PostNumber) = Me.ApplicantID

the bold code generates the following error message There is a problem accessing a property or method of the OLE object
 
If the ID is an autonumber, then Dim as a Long instead.

Also, the last part of the line posted is causing you problems:

= Me.ApplicantID

Why have that tagged onto the end?
 
Thanks I have chenaged the data type for the ID to be long and taken the = me.ApplicantID (this was an oversight). However, I am still getting the message.
 

Users who are viewing this thread

Back
Top Bottom