Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2004
    Posts
    43

    Question Unanswered: "Cancel" Button - PLEASE HELP!

    I am trying to create a "Cancel" button on a form. I'm not too hot on VBA and typically use Macros to navigate. Currently when I use the "Close" macro function, it saves any data that the user has entered.

    I would like to create a button that will allow the user to exit the form and NOT save any information that the user has entered.

    Can anyone PLEASE help me with this??

    Thanks
    Ryan

  2. #2
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    add this to your cancel button. this will undo if there are changes on the record before closing the form.

    Code:
     
    if Me.Dirty then me.undo
    docmd.close
    ghozy.

  3. #3
    Join Date
    Jul 2004
    Posts
    125
    Use the Close macro, select the object, and specify No for save. This will discard the record.

    In VBA it's DoCmd.Close acForm, Me.NAME, acSaveNo

  4. #4
    Join Date
    Jun 2004
    Location
    Florida, US
    Posts
    521
    also if you choose your cancel button's Cancel property true, it will activate when you press Esc key too.
    ghozy.

Posting Permissions

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