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!

SYntax error

Status
Not open for further replies.

starclassic

Technical User
May 24, 2007
27
US
I'm getting syntac error on this RunSQL

DoCmd.RunSQL "UPDATE tblCollectionsData Set tblCollectionsData.ContactMain = 1 WHERE (tblCollectionsData.PolicyNumber) = " & rst![PolicyNumber]

 
Is the policy number text or numeric? If it is text, try:
Code:
Dim strSQL as String
strSQL = "UPDATE tblCollectionsData " &  _
    "Set ContactMain = 1 " & _
    "WHERE PolicyNumber = """ & rst![PolicyNumber] & """"

DoCmd.RunSQL strSQL

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
Thanks dhookom,

That work fine. I'm amaze, don't know how you guys know all those double quotations. Always learn something new each day.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top