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

Compile Error: Expected: ( in Update statment

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
Using the following Update statement I get a "Compile Error: Expected: (" with the last appersand in the last line highlighted (the one directly after "strComp". I thought I've tried every variation with no luck. The string value strComp may contain hyphens. Can anybody see what I did wrong? Thanks.

strSQL = "Update Renewal"
strSQL = strSQL & " SET Renewal.SalesLastYr = " & lngSalesLastYr & ", " _
& "Renewal.LTM = " & lngLTM & ", Renewal.RenewalNotes = '" & mmoNotes & "'"
strSQL = strSQL & " WHERE Renewal.Comp = '" & strComp & "'
 
I just discovered strComp is the name of a function so I changed the variable name and it works fine so... never mind.
 
strComp is a VB function. That's what is causing your problem
 
Also, watch for any single quotes in [tt]mmoNotes [/tt] and in whatever you used for [tt]strComp[/tt]
If you allow to have them, they will couse a problem in your strSQL

Have fun.

---- Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top