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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can anybody see anything wrong with

Status
Not open for further replies.

antdickens

Programmer
Nov 13, 2001
129
GB
can anybody see anything wrong with this statement.

i am trying to select the description from the datafromchance table which has the same stock code as the pcode field on the form.


Me.desc1 = DLookup "[description1]", "datafromchance", "[stockcode] = me.pcode ")

i get a runtime error 2001

you cancelled the previous operation


all help greatly appreciated
 
Me.desc1 = DLookup ("[description1]", "datafromchance", "[stockcode] = me.pcode ")

Are u missing a " ( " after DLookup? Steve Medvid
"IT Consultant & Web Master"
 
You need to take the me.pcode out of the quotes since it's a variable. I believe you are also missing a beginning parentheses.


Me.desc1 = DLookup ("[description1]", "datafromchance", "[stockcode] = " & me.pcode)


Maq B-)
<insert witty signature here>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top