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!

Update function not working

Status
Not open for further replies.

BigLouie

Technical User
Dec 1, 2005
876
US
I am trying to update records in a table. The code I have created returns two errors. One that "UPDATE" is not defined and an Expected ) referencing "In". Here is the code. ANy help is greatly appreciated.

Function Cost()

Update ARInvoice
Set [ARInvoice]![SOUnitCost] = [ARInvoice]![SOUnitCost] * 1.06
WHERE ((([ARInvoice]![LineType]) = "1") And Not(([ARInvoice]![SOItemNumber]) In ("SV-PATROLIR","SV-PATROLIR-9","SV-PATROLIR-Q","SV-PATROLIR-Q9","SV-PATROLIR-B2","SV-PATROLIER-B2-9","SV-PATROLIR-VSK","SV-PATROLIR-HSK")))

End Function
 
Is that supposed to be VBA, SQL or something in between?
 
What about this ?
Function Cost()
DoCmd.RunSQL "UPDATE ARInvoice Set SOUnitCost=SOUnitCost * 1.06 WHERE LineType='1' AND NOT(SOItemNumber In ('SV-PATROLIR','SV-PATROLIR-9','SV-PATROLIR-Q','SV-PATROLIR-Q9','SV-PATROLIR-B2','SV-PATROLIER-B2-9','SV-PATROLIR-VSK','SV-PATROLIR-HSK'))"
End Function

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

Part and Inventory Search

Sponsor

Back
Top