Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Doesn't support this Property or method

Status
Not open for further replies.

DrSmyth

Technical User
Jul 16, 2003
557
GB
Hi,

I'm trying to get a dlookup to work on an access 97 form. The filed i'm looking for is called "AFSM Code" and it's in table "qlinks1", the field i'm using for the lookup in the form is called "Referral to name" and it's corresponding field in the table is "FPM/FPO Code".

Here's my code:

Code:
Me.AFSM = DLookup("[AFSM Code]", "qlinks1", "[FPM/FPO Code]= '" & Me.Referral_To_Name & "'")

However i'm getting a Run time 438 error. The only thing i can think of is that the field i'm looking up in the table is a text field that stores a number and/or this field ("FPM/FPO Code") is also used as the bound column in "Referral to name".

Hope this makes sense, can anybody help?

Thanks
 
Perhaps this ?
Me!AFSM = DLookup("[AFSM Code]", "qlinks1", "[FPM/FPO Code]= '" & Me![Referral To Name] & "'")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Cheers PHV, still getting the same error message
 
Have changed it a little to try and figure out where the code braeks down:
Code:
Dim str1 As String
str1 = CStr([Referral_To_Name])
MsgBox (DLookup("[AFSM Code]", "qLinks1", "[FPM/FPO Code]= '" & str1 & "'"))

And it actually breakes down on the line:
Code:
str1 = CStr([Referral_To_Name])

with the error message above
 
Use the expression builder (loaded forms) to discover the REAL name of the control.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top