Brother Arnold
Member
- Local time
- Today, 23:48
- Joined
- Apr 28, 2022
- Messages
- 39
I suspect this comes down to a lack of understanding but I've spent a couple of hours going down rabbit holes so I think I need a bit of help before I let it ruin my evening!
This is my update statement:
So what is happening here is that I'm updating the notes field for a specific appointment record. The primary key is ID. What actually happens is it updates the record that belongs to the primary key OK but it is also overwriting the appointment_notes in the first record in the appointment table which is the problem. I've rewritten the code using .execute and got the same problem which makes me think it's not the code. The form is about as simple as it gets - a text box and a save button. The form's record source and type is tblAppointment and Dynaset. the text box txtApptNotes is bound to appointment_notes. Any help would be much appreciated.
This is my update statement:
DoCmd.RunSQL "Update tblAppointment SET tblAppointment.appointment_notes = txtApptNotes WHERE tblAppointment.ID = " & p_lngID
So what is happening here is that I'm updating the notes field for a specific appointment record. The primary key is ID. What actually happens is it updates the record that belongs to the primary key OK but it is also overwriting the appointment_notes in the first record in the appointment table which is the problem. I've rewritten the code using .execute and got the same problem which makes me think it's not the code. The form is about as simple as it gets - a text box and a save button. The form's record source and type is tblAppointment and Dynaset. the text box txtApptNotes is bound to appointment_notes. Any help would be much appreciated.