Results 1 to 5 of 5
  1. #1
    Ranch1201 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2021
    Posts
    3

    Record saves if user logs off their computer

    I have an access program set up for employees to submit an overtime request. It is a front end/ back end program. When they fill out a request their is a submit button on the bottom that saves the request if their username and password match. There is another button to exit the program. If they exit the program a message box asks if they want to save the request. If they choose "no", the record is not saved and they exit the program.


    Problem: If they are filling out a request and should log off their computer, when they log back in to complete and submit their request, the program is shut down upon logging back on and their request is automatically saved. Is there a way to either:
    1- Prevent the program from shutting down so they can finish the request when they log back in, or
    2- If the program shuts down, is their a way to prevent the record from saving to where they have to fill out the form again.

    Users log into Windows 10 with their credentials and then double click to open the program.

    Thanks for any help on this....

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Are they logging off without first closing Access?

    1. I don't see how Access could reopen and display partially complete record unless it was actually saved to table.
    2. If record is saved, why would they have to fill out form again? Open form to saved record.

    Record is committed when 1) close table/query/bound form or 2) move to another record or 3) run code to save.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    Ranch1201 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2021
    Posts
    3
    Yes, they are logging off before closing Access. The person was half way through completing the form and had to leave, so they logged off Windows thinking they could finish when they log back in. When they logged back into Windows to finish the form, Access was closed (forced close from logging out?). They entered the program again and completed the form but his prior one (half filled out) had also been saved. Is there code that can undo what is written in a form upon closing or to keep access open if they log off?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    I don't think any app opened by user can be kept "open" when user logs off computer. This raises question of what happens when multiple users log on to same computer and open same app.

    I've never tried, but I suppose code behind form could cancel record if a certain condition is not met when form is closed by whatever initiated close (user or system). Perhaps declare a global boolean variable (gblBooSave), or use TempVars, and set this variable to True when user clicks button to save record. Code in form BeforeUpdate event would check this variable and if it is False, cancel commit.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Ranch1201 is offline Novice
    Windows 10 Access 2016
    Join Date
    Apr 2021
    Posts
    3
    I'll have to look into that. I'll post something if it works. Thanks

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

Similar Threads

  1. Replies: 3
    Last Post: 01-26-2021, 01:05 PM
  2. Log user off computer on database exit
    By redekopp in forum Access
    Replies: 4
    Last Post: 02-03-2017, 11:23 AM
  3. Replies: 6
    Last Post: 12-08-2014, 08:05 PM
  4. Replies: 2
    Last Post: 11-25-2014, 09:21 AM
  5. TextBox Knows the Computer User
    By MFS in forum Access
    Replies: 7
    Last Post: 05-12-2009, 02:00 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