I have a db in which I click a button, enter a value in the field, retrieve the record and display it in the form. I want to be able to change a value on the form, update the same record with the new changes. I get an error "update or cancelupdate without addnew or edit" when I try to do the update. How can I resolve this problem?
It sounds like you are trying to change a record that came from a RecordSet that was created in VBA. Once a recordset is created in VBA, it can be read, but to do any changes/updates, you must tell the recordset that you are going to edit the current record. That would be done using the name assigned to the recordset (let's assume "rs"). Therefore that would look like this: rs.Edit. After this statement, you can assign new values to the fields within the current record from the recordset. What I would wonder is why are you trying to use a VBA created recordset, when the form object will take care of that for you?