Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2004
    Posts
    39

    Unanswered: cancel and delete new row if the user doesn't confirm the action

    Hi,

    I need your help.
    I have a form with data source an ordinary table.
    When the user is inserting a new row I verify the data filled in.
    Actualy, I take a look at the data filled and I verify something in another table.
    After that, I'm asking with a MsgBox if he/she is sure to insert the new values.
    If Yes I will just let the program to continue normaly.
    If No, I want to stop the insertion and to delete the row from the form as it was at the beginning (as nothing happened).
    For canceling I used Cancel=True and it worked fine.
    The problem is that I cannot make the row empty as it was before and when I'm changing something on the form the Form_BeforeUpdate function is called. I want to avoid this call.
    thx for your help

  2. #2
    Join Date
    Mar 2004
    Location
    belgium
    Posts
    290
    could you not implement a requery ?

  3. #3
    Join Date
    Nov 2004
    Posts
    39
    I've tryed a Refresh just after the Cancel=True but now I have an error saying:
    "The macro or function set to the beforeupdate or validationrule property for this field is preventing Microsoft Office Access from saving data in the field."

  4. #4
    Join Date
    Nov 2004
    Posts
    23
    Try this to undo the changes to the record and set everything back to the the way it was before changes were made.

    DoCmd.DoMenuItem acFormBar, acEditMenu, acUndo, , acMenuVer70

    Jim

  5. #5
    Join Date
    Nov 2004
    Posts
    39
    thx dbjim
    it worked perfectly

Posting Permissions

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