Results 1 to 2 of 2
  1. #1
    jack.estes is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Mar 2018
    Posts
    1

    A "Cancel and Close" button on a form

    First off, I'm completely new to Access. Therefore, I'm sure this isn't too difficult of a problem to solve, but it's beyond me at the moment.

    I have a database I'm working on in my Office 365 subscription to store and track some inventory. The form in question has someone creating an inventory item by selecting some attributes from 3 drop down menu items, and then there are 3 buttons:

    - The first button saves the entry and moves to the next one


    - The second button saves the entry and closes the form
    - The third button is supposed to cancel/clear the entries and close the form without saving the inventory item. Therein lies my problem

    Can someone please help me out with some VBA code, or whatever is best for this situation, that will work?

    I've used the search feature on here, but when I've tried that, it didn't work. I did succeed in making it where the form wouldn't let me close it at all without going into a loop with a dialog box... Thankfully I back up frequently so that was an easy fix.

    Thanks in advance!!

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    you dont need the save action...when you move off the record, (close form, next rec,etc ) the record is automatically saved.
    use the Control Wizard to insert to MOVE NEXT REC button
    same with CLOSE FORM
    same with UNDO RECORD
    (you just put a button on the form and the wizard will ask you what to do)

    you can write a cancel rec command button (UNDO), but its just as easy to delete the saved record ,if you dont want it.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 11-17-2016, 10:55 AM
  2. Format Properties "Close Button" being ignored
    By GraeagleBill in forum Forms
    Replies: 2
    Last Post: 10-20-2015, 01:30 PM
  3. Replies: 8
    Last Post: 07-15-2014, 05:56 PM
  4. Suppress "Error" message following "Cancel = True"
    By GraeagleBill in forum Programming
    Replies: 7
    Last Post: 03-23-2014, 05:40 PM
  5. Replies: 7
    Last Post: 11-30-2013, 12:33 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums