Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Stopping autostart forms when opening Access from VB

Posted on 1998-02-17
7
Medium Priority
?
324 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
Technology Partners: 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!

 
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 400 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

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…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

916 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