Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Mathitria is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2020
    Posts
    9

    Routine to close database


    I have set a routine on closing an Access database, originally in Access 2010, but am now using Access 2019 (not on the registration list).

    Unfortunately I now need to edit the routine, but cannot find it in the VBA Project Explorer window. I have searched by Call and Function. (There is nothing under File > Options to help.)

    Does anyone know of anywhere else I can search?

  2. #2
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    2,439
    Perhaps the code you're looking for is in a form module.

  3. #3
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,264
    the code to close a database is docmd.quit - have you searched for that?

    alternatively perhaps your routine is a macro?

  4. #4
    isladogs's Avatar
    isladogs is offline Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    4,156
    Or the code could be Application.Quit
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

  5. #5
    Mathitria is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2020
    Posts
    9
    Quote Originally Posted by Bob Fitz View Post
    Perhaps the code you're looking for is in a form module.
    Thank you: I have looked through all the modules.

    I had hoped I might have attached the routine to the Main Page, which automatically opens when the database is opened, but unfortunately not.

  6. #6
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,264
    I presume in the vba window you have simply used find (ctrl-F) and just looked for the word 'quit'?

  7. #7
    Mathitria is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2020
    Posts
    9
    Quote Originally Posted by Ajax View Post
    I presume in the vba window you have simply used find (ctrl-F) and just looked for the word 'quit'?
    Yes, I have. Thank you!.

  8. #8
    isladogs's Avatar
    isladogs is offline Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    4,156
    OK if there is no VBA code to quit, you will need to look through embedded macros for the same output.
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

  9. #9
    Mathitria is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2020
    Posts
    9
    Quote Originally Posted by isladogs View Post
    Or the code could be Application.Quit
    Thank you: I have now searched for that!

  10. #10
    Mathitria is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2020
    Posts
    9
    Quote Originally Posted by isladogs View Post
    OK if there is no VBA code to quit, you will need to look through embedded macros for the same output.
    Would the macros be embedded only in a form? I'm fairly sure that I set the routine to run when the whole database is shut down.

  11. #11
    isladogs's Avatar
    isladogs is offline Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    4,156
    Its possible it could be a saved macro which will be relatively easy to check.
    However embedded macros could be used anywhere that an event procedure could be used in a form or (less likely) a report.
    Unfortunately, you will have to check these manually one by one
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

  12. #12
    Mathitria is offline Novice
    Windows 10 Access 2016
    Join Date
    Feb 2020
    Posts
    9
    Quote Originally Posted by isladogs View Post
    Its possible it could be a saved macro which will be relatively easy to check.
    However embedded macros could be used anywhere that an event procedure could be used in a form or (less likely) a report.
    Unfortunately, you will have to check these manually one by one
    Thank you: I have tried this.

    But I think I created a function, rather than a macro. I'm beginning to suspect that it has been deleted somehow.

  13. #13
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,264
    perhaps time for you to upload a copy of your db - perhaps a fresh pair of eyes? You can remove all the tables and queries since your routine will not be there, then compact and zip

  14. #14
    isladogs's Avatar
    isladogs is offline Very idle programmer
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    4,156
    But last check before you do that ...
    Open the Visual Basic Editor and do a search for Quit using Edit...Find
    Colin (Mendip Data Systems) : Website, email
    If this has helped, please click the star button and leave a comment

  15. #15
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,264
    already suggested that (post #6) OP says they have

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 01-05-2017, 06:49 PM
  2. Replies: 1
    Last Post: 03-21-2015, 11:55 AM
  3. Replies: 5
    Last Post: 09-01-2014, 12:11 PM
  4. What is routine database operations?
    By gaosanyong in forum Access
    Replies: 1
    Last Post: 12-13-2012, 02:40 PM
  5. Replies: 3
    Last Post: 02-09-2011, 07:43 AM

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 - Senior Forums