Results 1 to 8 of 8
  1. #1
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038

    Stop "Macro Single Step" to pop up once a file name been renamed

    Experts:

    I'm requiring some assistance with preventing the "AutoExec" dialog box to show up **after a the file name was changed**.

    Please find attached an example database. Follow the steps below:

    1st Time Opening the Database:
    1. Unzip database.
    2. Open up database "Test".


    3. You will get a prompt "Macro Single Step". Close on "Stop All Macros".
    4. Close form "User View".
    5. Click "Enable Content".
    6. Form "User View" pops up.
    7. Close database.

    2nd Time Opening the Database:
    1. Open up database "Test".
    2. Form "User View" pops up.

    As illustrated above, the 2nd time around, I do NOT get the "Macro Single Step" and "Enable Content" dialogue boxes. However, if I were to rename the database from, e.g., "Test" to "Test_2", I will receive the "Macro Single Step" and "Enable Content" dialogue all over again once I re-open the DB.

    Now, I'm actually perfectly having my users acknowledge/click on the "Enable Content" dialogue box. However, I do NOT want the users to always having to click on the "Macro Single Step" each time the file was copied/pasted/renamed.

    My question: How can I prevent the Macro-related dialogue box pop up while still tracking the login information in table "tbl_Db_UserTracking"?
    Attached Files Attached Files

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Check out the Northwind app's autoexec macro. It tests [CurrentProject].[IsTrusted] to determine how to proceed. It throws up a "please enable content" form if not trusted, the regular start form if trusted.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    Looking all over for the latest Northwind DB. Seems like many sites don't have it available any longer. Any recommendations where to pull it from?

    The template within Access failed... see JPG.
    Attached Thumbnails Attached Thumbnails Template Failed.JPG  

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Not offhand, I already had it. I would have assumed from MS. In any case, here's the macro:
    Attached Thumbnails Attached Thumbnails AutoExec.jpg  
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    Paul:

    I may need some additional assistance with the AutoExec macro. Here's the key as to whay I'm trying to achieve:
    - Attached is database "v02".
    - When I open it, I still get the AutoExec macro prompt. I don't want that!
    - Once I close both (AutoExec & Enable Content), the "User Review" form (i.e., frm_Sec_User_DbUsage_Review) pops up.
    - At that point, form "User Review" is empty. Once I close it and reopen it, it tracks that I'm currently logged in (logged out = null).
    - Great, this indicates that it logged the current/ongoing login instance.

    AutoExec macro:
    - It appears the key to tracking the login info is the "RunCode" = "Startup()".
    - In contrast to the original database, I now moved it into the both IF statements.
    - That is, I've put it into both "Not [CurrentProject].[IsTrusted]" and "[CurrentProject].[IsTrusted]".
    - Now, when I close the DB and reopen it, it won't track the login of the current DB instance, so somehow the "Startup()" didn't seem to get properly executed.

    Finally, even when I move the "Startup()" to its original place (see DB v01) I still get the AutoExex dialogue box each time I copy/rename the file.

    Is there any way you could provide some additional assistance on the AutoExex macro so that a) the login instance it tracked and b) I don't get pop up once the DB has been renamed?

    Thank you,
    Tom
    Attached Files Attached Files

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I think you're missing the point. Basically you want to do one thing if the app is trusted, another if it isn't. Your RunCode shouldn't be in the "Not Trusted" test, and you should open a different form than if the app is trusted. It would just be a form that says "you have to enable code blah blah". In your case, if the app isn't trusted they can't log in anyway, so there's nothing to track. If/when they enable code, the start code will run and away you go. The form in the "not trusted" test in Northwind just says:

    Welcome to the Northwind Traders sample database. In order to use this sample, click 'Options...' on the Message Bar and select 'Enable this content'. Alternatively, open the database from a Trusted Location.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    skydivetom is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Feb 2019
    Posts
    1,038
    Paul -- I got it to work now! You rock!!! Thousand thanks for the help... i truly appreciate it.

    Cheers

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 2
    Last Post: 08-15-2019, 10:22 PM
  2. Replies: 3
    Last Post: 05-28-2016, 07:35 AM
  3. Macro Single Step Error
    By cfspartan in forum Macros
    Replies: 6
    Last Post: 04-25-2015, 12:05 AM
  4. Export "Query or Report" to a "Delimited Text File"
    By hawzmolly in forum Import/Export Data
    Replies: 3
    Last Post: 08-31-2012, 08:00 AM
  5. Replies: 1
    Last Post: 04-07-2010, 08:49 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