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!

Update statement problem 1

Status
Not open for further replies.

iojbr

Technical User
Feb 12, 2003
129
US
Hi:

I keep getting an error message when I try to run this update statement. Is there something wrong with the syntax. Thanks in advance.

S5 = "Update [Safety Stock Base Table] SET [Product Description] = [Forms]![Receiving]!PD ,[SR-3 Requirement] = [Forms]![Receiving]!MSR,[Order Date] = [Forms]![Receiving]!Dt, [Order Time]= [Forms]![Receiving]!Tm WHERE ((([Part Number])= [Forms]![Receiving]!PON ));"

DoCmd.RunSQL S5
 
You need the values for the form data:

Code:
S5 = "Update [Safety Stock Base Table] SET [Product Description] = '" & _
[Forms]![Receiving]!PD _
& "',[SR-3 Requirement]='" & [Forms]![Receiving]!MSR _
& "',[Order Date] =#" & Format([Forms]![Receiving]!Dt,"yyyy/mm/dd") _
& "#, [Order Time]=#" & [Forms]![Receiving]!Tm _
& "# WHERE [Part Number]=" & [Forms]![Receiving]!PON

I have guessed at data types for the delimiters.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top