Solved

Turn off Autoexec if need be

Posted on 2006-06-19
9
447 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
  • 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 119

Accepted Solution

by:
Rey Obrero 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
 

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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
LVL 119

Expert Comment

by:Rey Obrero
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 119

Expert Comment

by:Rey Obrero
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now