Solved

Stopping autostart forms when opening Access from VB

Posted on 1998-02-17
7
318 Views
Last Modified: 2010-08-05
I have a program which opens an Access database from within VB.
When it opens a database that has an autostart macro or form it automatically runs it but I want to open it in design mode only.
There do not seem to be any parameters on the OPENCURRENTDATABASE command.

How can I stop them being executed ?
0
Comment
Question by:cmy9
7 Comments
 
LVL 7

Expert Comment

by:kamall
ID: 1457282
You can use the 'Data Form Designer' (VB4) or 'VB Application Wizard' (VB5) to automatically create your data forms directly from the database. Your project will not show the forms or run the macros stored inside the database.

Best regards
0
 
LVL 2

Expert Comment

by:marti
ID: 1457283
Why not using '/cmd' command-line option?
0
 

Author Comment

by:cmy9
ID: 1457284
I am trying to analyze Access databases created by other users WITHOUT modifying them.

Try this on the Northwind database supplied with Access:
- Create a new VB5 project and add the Access 8.0 reference
- Use "access.OpenCurrentDatabase ("path\northwind.mdb")

You will see that the initial startup form appears.
I want to open this database without starting this form.
0
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.

 
LVL 6

Expert Comment

by:anthonyc
ID: 1457285
Analyse Forms/Reports/Macros etc or data tables and queries?
0
 
LVL 2

Accepted Solution

by:
marti earned 200 total points
ID: 1457286
Holding (or holding simulation) the SHIFT key will prevent autoexec macro from executing. I hope this will work for you.
Regards
0
 

Author Comment

by:cmy9
ID: 1457287
I am aware that holding down the shift key when opening Access manually stops autostart forms/macros running but how do I simulate this from within VB when opening an OLE conversation ?

I guess you are suggesting it is possible to simulate the shift key in conjunction with a SHELL command but will this then give me  the ability to use OLE automation (e.g. the use of the MODULES collection) and if so, how do I do this simulation ?


0
 
LVL 2

Expert Comment

by:marti
ID: 1457288
I was able to establish OLE Automation with '\northwind.mdb', manualy holding the Shift. Isn't it what you are looking for?
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBS file using code from 2nd file (txt or vbs) 4 42
Modifying Conditional Format from VBA code 3 59
MS Access 03, TransferText, decimal places 8 78
Excel Automation VBA 19 88
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

792 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