Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

By pass startup form / macros 2

Status
Not open for further replies.

MajP

Technical User
Aug 27, 2005
9,382
0
0
US
I have checked past threads on this, and googled it but could not find an answer. I thought I remember seeing a post with a solution. I am Looking for a way to open some external databases and bypass the startup form or autoexec. Most of my dbs open with a dialog startup form.
I found this older code
Uses the api to simulate the shift key, but I could not get it to work and not very knowledgeable on API. The information I need requires the database to load and can not be retrieved by ADO/DAO or the application object. These dbs have no security or shift bypass disabled set. Any help is appreciated.
 
Yes, I was trying to make the procedures bullet proof and standalone, and not optimized. I did not feel like including error checks. You could just try to get a property and if it does not exist trap the error. Since there can never be that many properties, it may be inefficient, but still nearly instantaneous to loop them all.

With that said. Could make it a little more efficient. If there is never a startupform there is not a property. If there was a start up form and then the user changes it to (none) there is a property with a value of "(none)".

so
startUpform = getStartUp(db)
So if there is not startupform function returns a value of "" or "(none)"
now can check to see if you need to even call the other form methods
if not (startUpForm = "" or startUpForm = "(None)") then

Similar to the autoexec process. That is a more problematic and you definitely want to check if there is an autoexec. The methods run fine if there is not but there is a flicker and possible message.


Mazeworx,
Those are two things I no nothing about: registry, and API. So not going to mess with that.

However, this can all be done with the shift key. So if someone can get the Dev Ashish code to work that would be a much cleaner solution.
 
because if the property doesn't exist and we try to change it it, it will throw an error.

Of course. I was assuming that you would only run this on databases that you knew had a StartUp Form (or else why run it?) but that may be a bad assumption. If you are not sure, check first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top