Good Morning,
I have a form that I'm creating to update volume delivered by suppliers.
I want to be able to pick a date from a drop down, Pick the order number and insert then the volume into a text box and it up date my table at the click of a button
The query I have is as follows:
Private Sub Command21_Click()Dim volume As Variant
Dim Deliverydate As Variant
Dim setdelivery As String
Dim OrderIDNo As Variant
OrderIDNo = Text22.Value
volume = Text19.Value
Deliverydate = Combo24.Value
setdelivery = "Update DeliveryTemplate " & _
"Set " & Deliverydate & " = '" & volume & "' " & _
"where [OrderID] = '" & OrderIDNo & "' "
DoCmd.RunSQL "setdelivery"
End Sub
When I click the button I get the following error - Run Time error 3129 Invalid SQL statement
So I went into Debug and got the query from the Immediate window which returned the following:
Update DeliveryTemplate Set June13 = '999' where [OrderID] = '1'
I copied and pasted this into a standard access query and ran it as normal to try and find an error but it ran fine and updated as requested
Does anyone know why it will work in a standard query but not through VBA on my form?
Any help would be much appreciated
Thank you