Results 1 to 4 of 4
  1. #1
    DC CS is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Vaalpark, South Africa
    Posts
    84

    Access not closing

    Hi,
    I am using MS Access 365 on the development platform and running MS Access LTSC MSO (16.0.14332.20478) 64-Bit on the remote desktop server.

    When I run the database and exit in the normal manner in the development platform, all is fine.
    Once I run the same database from the remote server, all is running fine, except the "Application.Quit".

    The database closes, but Access does not close. This results in me to use the task manager (or Server Manager) to close Access or log off the user.

    I have used the "Docmd.Quit" and "Application.Quit" with the same results.

    Sometimes when the users log in, Access closes like it should, but most of the time, Access remains open.



    Any suggestions?

    Thanks
    Deon

  2. #2
    KNicholson is offline Novice
    Windows 10 Office 365
    Join Date
    Mar 2023
    Posts
    6
    You can force the users to only be permitted to exit the Access application from your form that opens when the database is opened.
    Add this code to your Application:
    Option Compare Database
    Option Explicit


    Private CanClose As Boolean
    '-------------
    On your form, in the cmdClose: (mine is always called frmMainMenu):

    Private Sub cmdClose_Click()
    If MsgBox("Are you sure?", vbQuestion + vbYesNo, "Quit Program") = vbNo Then
    Exit Sub
    Else
    CanClose = True
    DoCmd.Quit acQuitSaveNone
    End If


    End Sub

    and on unload of your Main Form:
    Private Sub Form_Unload(Cancel As Integer)
    Cancel = Not CanClose
    End Sub




    Cancel = Not CanClose

  3. #3
    DC CS is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Vaalpark, South Africa
    Posts
    84
    Hi, Thanks, but this is not the issue. Although I force them to use the "Quit" button, MS Access still does not close completely. The program / database closes, but a copy of Access remains open, causing the ".laccdb" file to remain open, and cannot be deleted because it is open in Access.

    I played around with the Trusted Centre settings and added all the folders the program will access. I also "Enable all Macros", but with no effect.

    NOTE: Running this DB from my local disk, does not have this issue. Access closes as it should. This happens when I run the program on a remote server using RDP. I also ticked the "Allow Trusted Locations on my Network.", but still Access does not close completly.

    There is a separate DB running on the same RDP without any issues, so I assume the problem lies with the specific program in question.

    Any suggestions?

    Thanks

  4. #4
    Join Date
    Apr 2017
    Posts
    1,776
    Quote Originally Posted by DC CS View Post
    ... This happens when I run the program on a remote server using RDP. ...
    I think you have hit your problem here!

    To work with Access app on remote server, you have to run the app from LAN where this server is running. The working way is:
    Have your Access app or BE of your app on server in remote LAN;
    Have a Terminal Server installed in same remote LAN, and on TS have user profiles for users of your app;
    Have Access installed on this TS for every user;
    In user profile of every app user on TS, or on some other shared resource in same LAN, have a copy of app's FE for every user (in case you app is split to BE and FE's).

    Users log in into TS, and start their FE (or the single user starts the app) from there.

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

Similar Threads

  1. Closing an Access database.
    By Robert2150 in forum Access
    Replies: 1
    Last Post: 07-26-2022, 12:25 PM
  2. Replies: 4
    Last Post: 02-03-2022, 12:42 PM
  3. ACCESS keeps closing
    By robirdman in forum Access
    Replies: 17
    Last Post: 10-26-2020, 05:01 AM
  4. Closing access database without saving
    By onaggar in forum Access
    Replies: 7
    Last Post: 12-19-2013, 06:23 PM
  5. Closing applications outside of Access?
    By ElEmEn in forum Programming
    Replies: 1
    Last Post: 10-13-2013, 07:03 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