Results 1 to 3 of 3

Thread: MS Access

  1. #1
    Join Date
    Apr 2007
    Posts
    18

    Unanswered: MS Access

    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?

    Thanks - access newbie

  2. #2
    Join Date
    Jan 2007
    Location
    California, USA
    Posts
    520
    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?

  3. #3
    Join Date
    Apr 2007
    Posts
    18

    MS Access

    Thanks.
    Your direction was very much appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •