Solved

Stopping autostart forms when opening Access from VB

Posted on 1998-02-17
7
320 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: 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 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

710 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