By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,376 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

OpenCurrentDatabase without invoking Autoexed

P: n/a
Hello,

I would like to have one Access program scan a directory and look at the form,
report and module code of any Access databases it finds to search for
keywords.

The best way I have found to do this is with the OpenCurrentDatabase method of
an Access.Application object. However this starts the DB having it do
whatever it would do when it starts up, which may involve refreshing data from
other DB which it cannot find, etc. I would like something like
OpenCurrentDatabase, but which would have the effect of opening the DB with
the shift key pressed.

The only other way I have found that might work would be to use the
containers("forms"), etc. collection from a DAO.Database object. But this
just gets the names of the objects of interest. To get at the module code I
would have to import each form into my DB to look at the code. This does not
seem as clean as I would like it.

Any ideas?

TIA
May 1 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Hi, Gary.
I would like something like OpenCurrentDatabase, but which would have the
effect of opening the DB with the shift key pressed.
Wish for something, and it might come true. If the AllowBypass Key hasn't
been disabled, then you can use the Windows API to programmatically press
the <SHIFT> key. Use the code on the following Web page:

http://www.mvps.org/access/api/api0068.htm

Within the fGetRefNoAutoexec( ) function, you can write your code that you
need to automate the remote database, or even call a local procedure to run
right after the remote database is opened. For example:

' Open a mdb with Autoexec
Call .OpenCurrentDatabase(strMDBPath, False)

' Do whatever in this section to automate the remote DB.
Call mySub

' Revert back keyboard state
Call SetKeyboardState(abytCodesSrc(0))

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"Gary Floam" <fl***@comcast.net> wrote in message
news:7K******************************@comcast.com. .. Hello,

I would like to have one Access program scan a directory and look at the
form, report and module code of any Access databases it finds to search
for keywords.

The best way I have found to do this is with the OpenCurrentDatabase
method of an Access.Application object. However this starts the DB having
it do whatever it would do when it starts up, which may involve refreshing
data from other DB which it cannot find, etc. I would like something like
OpenCurrentDatabase, but which would have the effect of opening the DB
with the shift key pressed.

The only other way I have found that might work would be to use the
containers("forms"), etc. collection from a DAO.Database object. But this
just gets the names of the objects of interest. To get at the module code
I would have to import each form into my DB to look at the code. This
does not seem as clean as I would like it.

Any ideas?

TIA

May 1 '06 #2

P: n/a
Thanks Gunny,

I never would have figured this out on my own.

Gary
May 1 '06 #3

P: n/a
You're welcome. Glad to help.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.
"Gary Floam" <fl***@comcast.net> wrote in message
news:ut******************************@comcast.com. ..
Thanks Gunny,

I never would have figured this out on my own.

Gary

May 1 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.