Solved

Turn off Autoexec if need be

Posted on 2006-06-19
9
450 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 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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

775 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