Solved

Turn off Autoexec if need be

Posted on 2006-06-19
9
454 Views
Last Modified: 2008-02-26
I have a group of mdbs, the first mdb runs code the launches the 2nd mdb and launches the autoexec - which imports some tables from an external mdb.  Then the code in my 1st mdb continues to zip the 2nd mdb file and filecopy it -allow the user to copy the zip file to their own pc.

The problems lies with when the user opens the zip file the autoexec on the copied 2nd mdb will still be active,  It is here that I want to deactivate the autoexec on the copied mdb.

Is this possible and if so can you point me in the right direction.

Thanks,

Karen
0
Comment
Question by:Karen Schaefer
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 65

Expert Comment

by:Jim Horn
ID: 16936511
Without getting into the specifics of your zip deployment, instead of AutoExec macros you could assign a Startup Form in Tools menu: Startup.  Then, in that form's Open event you could write VBA code that could test for the existance of another instance of Access running, and behave accordingly.

0
 

Author Comment

by:Karen Schaefer
ID: 16936580
Thank you for the suggestion, however, this will not work in my case- My original mdb prior to be zipped needs to import the two tables.  If is after the mdb is zipped and is waiting for the user to open the 3mdb that file copies the zip file to their local machine.   It is the copy on the local machine that I need to deactivate the autoexec.

Thanks,

karen
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 16936661
maybe you can insert the following commands at the very last part of the autoexec macro

Action
-------
Rename


New Name   remAutoexec
Object type  Macro
Old Name    Autoexec


this is just renaming the autoexec macro to remAutoexec

or probably deleting it

Action
-------
DeleteObject



Object type     Macro
Object Name    Autoexec




0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Karen Schaefer
ID: 16937171
Capricon,

Thanks,

Sometimes it is the simpliest solution is the best.

Thanks for the great idea.

Karen
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 16937372
U R Welcome!!!
0
 

Author Comment

by:Karen Schaefer
ID: 16937373
Sorry 1 more question - Where would be the best place to put this so it affects only the copied version and not the original.

Karen
0
 

Author Comment

by:Karen Schaefer
ID: 16937422
My orignial code has me processing the 2nd mdb and then closing it and then zip the update mdb and then 3rd mdb is opened by user for them to save to their pc.

Should I do a filecopy of the original mdb, reopen the copy - rename the autoexec in that copy and then zip it?

What do you think.

Karen
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 16938687
<Should I do a filecopy of the original mdb, reopen the copy - rename the autoexec in that copy and then zip it?>

right, i think this is the best way of doing this.
0
 

Author Comment

by:Karen Schaefer
ID: 16938820
I end up not using this - I added a if statement comparing the current filename and if <> to then I ran the autoexec code.

Thanks for the input.

K
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question