Solved

Turn off Autoexec if need be

Posted on 2006-06-19
9
448 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
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…
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

914 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