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

Run SQL Syntax question

Status
Not open for further replies.

jimbo62

Technical User
Oct 19, 2002
43
0
0
US
I am having trouble referencing a list box value in a sql stsement it tells me my syntax in incorrect. Can anyone help?

DoCmd.RunSQL "UPDATE MainParts SET MainParts.ResourceName = (Forms!Parts.[List34].Column(0))WHERE((Forms!Parts.[Text20].Value=(MainParts.PartNum)))"

Jimbo[bigsmile]
 
I cured my problem with the list box reference by assigning the value to a text box and using that instead.

If anyone can assist with my original question it would be appreciated.

I must be getting tired...

Thanks

Jimbo[bigsmile]
 
Perhaps this ?
Code:
DoCmd.RunSQL "UPDATE MainParts SET ResourceName='" & Forms!Parts!List34.Column(0) & "' WHERE PartNum='" & Forms!Parts!Text20 & "'"

If either PartNum or ResourceName is defined as numeric in MainParts then get rid of the corresponding single quotes.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top