cardgunner
Registered User.
- Local time
- Today, 06:47
- Joined
- Aug 8, 2005
- Messages
- 210
This is my first bit of code I have written. So I apologize in advance.
In my order form if the amount gets changed then ask if you would like to update the producttbl with that amount.
So I have the following
Table=producttble
fields=productname, amount
form=Form1
fields=cboname,txtamount
most of this I copied from sample code on unrelated db.
when I change the field and select yes I get a "syntax error in update statement"
Edit:
Sorry, the table of form1 is the ordertbl. The amount in that table will get updated when the form is closed or refreshed.
I'm looking to update the main producttbl if the user wants that new price to be the correct one.
In my order form if the amount gets changed then ask if you would like to update the producttbl with that amount.
So I have the following
Code:
Private Sub txtamount_Change()
Dim Message, Buttons, Choice
Message = "Do you want to Update the product group with this new price?" & Chr(10) & Chr(10)
Buttons = vbYesNo
Choice = MsgBox(Message, Buttons)
If Choice = vbNo Then
Exit Sub
Else:
Dim db As Database
Set db = CurrentDb()
db.Execute "UPDATE producttbl on producttbl.productname=Forms![Form1]!cboname set producttble.amount=Forms![Form1]!txtamount "
End If
End Sub
Table=producttble
fields=productname, amount
form=Form1
fields=cboname,txtamount
most of this I copied from sample code on unrelated db.
when I change the field and select yes I get a "syntax error in update statement"
Edit:
Sorry, the table of form1 is the ordertbl. The amount in that table will get updated when the form is closed or refreshed.
I'm looking to update the main producttbl if the user wants that new price to be the correct one.
Last edited: