I am trying to update a table with values from a Form. Here is the code that I am using on the command button;
CurrentDb.Execute "Update Customer_Notes set Customer_Notes.Customer_Number = '" & Me.CustomerNumber.Value & "'"
CurrentDb.Execute "Update Customer_Notes set Customer_Notes.Comments= '" & Me.Comments.Value & "'"
The values are coming from the CustomerNumber and Comments controls of the Form. It works, but instead of just updating the record that corresponds to the Customer number, it is updating all of the records on the table with the new value, which is not good. Do I need to add a 'where' statement? If so, could anyone give me a clue on how to add it. This is the last piece, and I will be very happy to get it completed.
Thanks in advance for the assistance, the forum has been very usefull!
CurrentDb.Execute "Update Customer_Notes set Customer_Notes.Customer_Number = '" & Me.CustomerNumber.Value & "'"
CurrentDb.Execute "Update Customer_Notes set Customer_Notes.Comments= '" & Me.Comments.Value & "'"
The values are coming from the CustomerNumber and Comments controls of the Form. It works, but instead of just updating the record that corresponds to the Customer number, it is updating all of the records on the table with the new value, which is not good. Do I need to add a 'where' statement? If so, could anyone give me a clue on how to add it. This is the last piece, and I will be very happy to get it completed.
Thanks in advance for the assistance, the forum has been very usefull!