Results 1 to 4 of 4
  1. #1
    SteveApa is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    84

    Delay start of Autoexec until macros are enables and db is trusted?

    Hi.
    Doing a front end / back end with a starter db. The starter db checks for existence of front end on users system and the version. If the front end does not exist or is an old version it will create a directory (if needed) and copy the front end from a sharepoint to the users system. Then the starter db will start the front end on the users system and close itself.

    The issue is macro enabling and trust center. My starter, and the front end both have autoexec macros. But I get errors when the autoexecs fire off because macro enable has not been hit yet and the db is not trusted.



    How do I handle this? How can I delay the start of the autoexec until after macros are enabled?

    I was thinking about having a table with a number_of_times_run field. If the number of times run is Zero... Then I would open a form to allow a delay, and have a command button that would fire off the true autoexec and change the number_of_times_run to One. Then I could check the field the next time run and since it would not be Zero, I would just run the true autoexec... What do you think? Any better suggestions?

    Thanks.
    Steve

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    Don't really know what you mean be a 'starter db'. Doesn't sound like something I've ever encountered. We just set everyone's Access app to "Enable all macros" because my users don't run any other databases.

    I've never used autoexec macro. I don't use macros if I can help it, only VBA. I do have an autokeys macro because couldn't find VBA way to accomplish. What is purpose of your autoexec?

    The table you suggest would have to be in the backend and maintain a record for each user.
    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
    SteveApa is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2015
    Posts
    84
    Hi June7.
    A starter db is a database that the user runs - they think it is the final database. The starter database has a linked table to a copy of the front end on the sharepoint which has a version number in a table. Also the starter has a linked table to the front end on the local machine which has the local version. If the versions are different, then my VB copies the newest version from the sharepoint and puts it on the local system. When this is done, the starter fires up the front end on the local machine and closes the starter database... OK. Now. I don't use macros when I don't need too... Usually VB. But, in this case I cannot run VB in an autoexec macro (autoexec macro is the first thing to start once the database loads - I guess it is like a switchboard. VB won't run until the user enables macros... By this time, the macros / vb has already failed. So... This is what I am working on... I start with 1 autoexec that opens a form with a cmd button on it. Once the user enables macros, they hit the cmd button and it fires off the vb. At the end of the vb, I delete the autoexec and copy a different one to the autoexec name. This will now be a different autoexec for the 2nd time they run which will be after they enable macros.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,953
    Sorry, no experience with SharePoint. I can only suggest you give the idea a try.

    I guess if the 'starter' db is never replaced, the table could be located there and would have only the one record.

    I also do versioning to update users' copies of frontend on their local PC but SharePoint is not involved, just our network server and no 'starter' db. The copy code is within the full frontend. I don't use autoexec or db Options for loading form. I have customized ribbon code that loads the initial form.
    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.

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

Similar Threads

  1. Button that enables all macros?
    By arothacker in forum Access
    Replies: 8
    Last Post: 02-20-2014, 07:59 AM
  2. Replies: 20
    Last Post: 05-05-2013, 03:40 PM
  3. Replies: 7
    Last Post: 06-14-2012, 01:54 PM
  4. Delay in the result
    By markyboy in forum Forms
    Replies: 1
    Last Post: 05-25-2011, 09:19 AM
  5. Replies: 0
    Last Post: 07-09-2010, 06:22 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