Results 1 to 3 of 3

Strange behaviour of MS Access form

  1. #1
    selvakumar.arc is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    49

    Strange behaviour of MS Access form

    In my MS Access application there is a data entry page. The expected hebaviour is user need to enter input and press "Save" button then record should be saved in the database. But the issue here is if the user enter any value and if the user exit from the application, also saving the result. In my form I have only 2 events, Save onclick and Exit onclick events. In save button I added some value assignment statement and in exit just exit (Docmd.close) from the application. When ever user click Exit or "X" from the form, then record get saved in database. I am not understanding what is the issue here.
    I am using Identity key for the record indexing (Auto increment identity key) and form type is "Single Form".



    Regards,
    Selvakumar R

  2. #2
    offie is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2013
    Posts
    176
    I'm not quite sure what your question is here, is the exit command button not saving?
    In the "Event" part of properties there is an "AfterUpdate" row where you can enter code. So you can choose the form, or individual tex boxes, etc, and add code to save (DoCmd.Save...) whenever it is updated.
    Does that answer your question?

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    8,258
    When ever user click Exit or "X" from the form, then record get saved in database. I am not understanding what is the issue here.
    This is normal behavior.

    If you entered/changed data in a record, then, without clicking on anything to save the changes, you move to another record, Access automatically saves the changes.
    Data/changes are also automatically saved when you exit Access, no matter how you quit - File/Exit, the "X" in the upper right hand of the window or a button with code...

    If you do not want changes saved when you exit Access, you will need to disable the "X" and add code to trap the exit command and undo any changes before allowing Access to quit.
    HTH
    -----
    Steve
    --------------------------------
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

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

Similar Threads

  1. Replies: 5
    Last Post: 04-15-2013, 12:54 AM
  2. Strange TableDef behaviour
    By tym in forum Access
    Replies: 12
    Last Post: 11-24-2011, 03:16 AM
  3. Replies: 6
    Last Post: 03-17-2010, 10:09 PM
  4. Odd Form Behaviour
    By FrankHelbert in forum Access
    Replies: 1
    Last Post: 03-13-2010, 04:56 PM
  5. Qurey on two ODBC Tables Strange behaviour
    By tingletangle in forum Queries
    Replies: 1
    Last Post: 01-14-2010, 03:40 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
  •  
Tech Forums: Microsoft Office Forums