Results 1 to 2 of 2
  1. #1
    Join Date
    May 2002

    Angry Unanswered: Re: unable to move to next record after editing

    Hi all,

    I'm having trouble moving to next record after making a change in the subform. I have eight checkboxes, previous and next buttons in the subform. After reselecting a check box When I click on either previous or next button I get one of these messages.
    I'm hoping someone can provide an explanation or a solution.
    Thanks for your input.

    MS VB:
    Run-time error 2115
    The macro or function set to the BeforeUpdate or ValidationRule property for this field is preventing MS Access from saving the data in the field.
    End Debug

    Occurred cmdPrevious_click event
    Set rst = Me.Recordset
    Set rstclone = Me.RecordsetClone
    --> DoCmd.RunCommand acCmdSaveRecord
    rstclone.Bookmark = rst.Bookmark
    if I leave the docmd.runcommand out this error message will appear:
    Row cannot be located for updating. Some values may have been changed since it was last read.
    Set rst = Me.Recordset
    Set rstclone = Me.RecordsetClone
    rstclone.Bookmark = rst.Bookmark
    error here--> rst.MovePrevious

  2. #2
    Join Date
    Nov 2004
    out on a limb
    Provided Answers: 59
    So what is the code in the beforeupdate event that is stopping the update happen
    Presumably you have some validation code which is setting the cancel flag because the data is invalid.
    So you are trying to save your changes but before the update event kicks off you are running a piece of code which trys to move to a new record BEFORE the pendingchanges are saved. I wonder why thats failing then?

    Suggest you place you code to update the bookmark in the afterupdate event (after you've updated the recordset)
    BTW: it seems pointless to set a bookmark, move off it then move back to the bookmark.

Posting Permissions

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