Results 1 to 11 of 11
  1. #1
    kdbailey is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    228

    Macro that runs when access closes

    I am wondering if there is a command that runs when access is closed.

    I want to write the current user's username to a table when the database is opened with an "AutoExec" macro.



    I then want to delete the current user's username from the table when the database is closed.

    The general idea is to create an Active Users Table within the DB that does not go by computer ID.

    Is there a macro similar to "autoexec" that will run on close?

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Quote Originally Posted by kdbailey View Post
    I am wondering if there is a command that runs when access is closed.

    I want to write the current user's username to a table when the database is opened with an "AutoExec" macro.

    I then want to delete the current user's username from the table when the database is closed.

    The general idea is to create an Active Users Table within the DB that does not go by computer ID.

    Is there a macro similar to "autoexec" that will run on close?
    I don't think there is anything like that but you could use a form that is opened but hidden when the db opens and then put your code in the On Close of that form.

    Can I ask why you need to store the user's username while the db is open.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    kdbailey is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    228
    Thank you, this will do exactly what I need. The database is in pilot mode with numerous users, if something needs updating, I would like to know who to contact.

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Do you have simultaneous users.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    kdbailey is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    228
    Yes, I believe what I just set up should do the job.

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Have you split the db, with a single back end, and each user having a copy of the front end which are linked to the back end.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    kdbailey is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    228
    I have not, I am not entirely sure that this would be ideal for what I created it for. There is a lot of simultaneous new input as well as data retrieval. If every transaction has to go through linked tables it would not be too efficient. The amount of users is not significant where I have to track down 25 people. But when a few people are in at the same time, I would like to know who.

  8. #8
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    As Bob indicated, if you have simultaneous users in a database where records are changed(updated,inserted, deleted) and you are not running FE/BE, you are very likely to experience problems - including corrupted database.
    see this from M$oft

    You could use Google/Bing tofind additional info.

    Please tell us more about your efficiency concerns.
    Here is some info

    Good luck with your project.

  9. #9
    kdbailey is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    228
    Ok, I split the database to see how this would work. So the backend is where all of the updates should occur. No updates should happen on the front end, correct?

  10. #10
    kdbailey is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Aug 2012
    Posts
    228
    Would this run the best if I gave each of the users their own copy of the front end?

  11. #11
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    The quick answer is YES, but you should do some more research on related performance tips.
    And how you send any updates to the FE to the current users.

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

Similar Threads

  1. Replies: 2
    Last Post: 03-29-2012, 07:45 AM
  2. Replies: 0
    Last Post: 12-03-2010, 12:56 AM
  3. Exception When Executing In Java But Runs In MS Access DB Manually
    By vasuresh.kishor@gmail.com in forum Access
    Replies: 0
    Last Post: 03-11-2010, 12:22 AM
  4. Change to Form Closes Access
    By jbhjm in forum Forms
    Replies: 5
    Last Post: 04-22-2009, 01:04 PM
  5. Replies: 1
    Last Post: 12-09-2005, 09:16 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