Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / July 2005

Tip: Looking for answers? Try searching our database.

How to bypass autoexec using OpenCurrentDatabase

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Shaun - 25 Jul 2005 17:36 GMT
Do you know how to bypass the AutoExec macro of an MDB that you are opening
with the following code snip, just as if you held SHIFT down when you opened
it manually?
 Set App = New Access.Application
 app.OpenCurrentDatabase, "test.MDB", False
Tim Ferguson - 25 Jul 2005 17:42 GMT
> Do you know how to bypass the AutoExec macro of an MDB that you are
> opening with the following code snip, just as if you held SHIFT down
> when you opened it manually?
>   Set App = New Access.Application
>   app.OpenCurrentDatabase, "test.MDB", False

If you are opening it as an Access Application, then it's reasonable for
the autoexec to run because it may be preparing the user interface or other
control or access mechanisms before showing anything to the user.

If you want to access the data tables, though, then don't bother using the
UI at all; just use the OpenDatabase or CreateConnection methods instead.

Hope that helps

Tim F
Shaun - 25 Jul 2005 17:50 GMT
I am trying to enumerate the controls on the forms, and the controls on the
reports, within "test.mdb", similar to the way FMS Tools Total Access
Analyzer works.  The only way I know of to do this is to open the form with
app.docmd.openform ... so I need to find a way to hold the shift key down as
requested.

> > Do you know how to bypass the AutoExec macro of an MDB that you are
> > opening with the following code snip, just as if you held SHIFT down
[quoted text clipped - 12 lines]
>
> Tim F
Tim Ferguson - 26 Jul 2005 17:08 GMT
> I am trying to enumerate the controls on the forms, and the controls
> on the reports, within "test.mdb", similar to the way FMS Tools Total
> Access Analyzer works.  

I wouldn't dare to try to reverse engineer FMS tools stuff so I wouldn't
know. OLE automation would seem to be the last resort though. Best way
would be to get a suitable agreement with microsoft and use the mdb file
structure.

Just a thought: can you not access the forms and their controls via the
Documents container?

Then again, if I wanted to know how many controls there are on a form, I'd
open it in design mode and count them. But then again, I'm a kind "why make
it more complicated that it needs to be" sort of person...

Best of luck

Tim F
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.