Setting properties at startup

paulhorn

Board Regular
Joined
May 28, 2004
Messages
63
Can anyone tell me - is it possible (using VB) to set certain defaults at start up?
I have been developing an Access '97 database which is shortly to be used in anger, although it is a long way from the finished article. I do not want to compile it as an MDE because there will be numerous changes/amendments in the coming months. I would like to be able to set two options (in the Tools:Options menu), namely;
disable 'Confirm Action queries', and hide 'hidden objects'

Are there any 'Docmd' type commands that I can use (and where do I put them so they run at startup)?

THanks for ANY guidance
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
Hi,

I'm not sure if I understand this 100% but you can do this without VB by creating a macro with the name "Autoexec", add the commands you want to run at start-up and it will run automatically every time you open the database. This can definitely be used to hide objects such as the database window. Is this what you are looking for? I suppose you could also turn the warnings off at this point too but as an alternative, you can turn the warnings on and off (SetWarnings) for each query via the macro that runs the query.

HTH, Andrew. :)
 
Upvote 0
Hi Andrew,
Thanks for the quick reply. I had not realised this could be done via the auto exec, and will investigate ASAP. I guess I just thought that a few 'DoCmd command lines would be simpler + a bit tidier! Just shows that I don't in fact know very much at all!!

Thanks again
 
Upvote 0
Andrew,
Now I'm not sure I understand 100%!
I tried creating an AutoExec macro with just one line (Setwarnings=No)
But I still get the action query warning when I run Delete/append/Update queries?

Perhaps I should have explained a bit better.

My intention was twofold;

to protect the design of forms,queries, macros etc without going to the lengths of setting security levels - the intended users are not too Access 'savvy' (a bit like me it seems!), and because of the perceived number of revisions which will be required before it is the finished article. I decided to set the hidden properties of all queries,forms macros etc, then set 'Show hidden items' in the tools;options menu to false. I know this is no good to anyone who knows where to look, but it will be good enough until I reach a final release stage (since only a small number of people will have access to it).

to avoid 'clutter'. The database is menu/command button driven, with its own warnings forms/msg boxes. But the default for most Access applications seems to be to 'set notification of action queries to TRUE'. In order to guarantee to avoid this, I need to set this to False for as long as the database is open.

Does this make any more sense, or am I still missing the plot :oops:

Thanks again
 
Upvote 0
Why not do what you didn't want to do?
Compile it into a MDE and keep your development version separate?

You're probably going to have to redistribute the updated copies anyways.

Mike
 
Upvote 0
THanks for the thought Mike. Unfortunately, the culture of this organisation will mean that I will be bouncing like a yo-yo making piecemeal changes, instead of saving them up and doing it in several 'big hits'. As you say, I may have to go there, but STILL hope there is a VB solution.
 
Upvote 0
Hi Paul

From the sound of it your database is form driven to accommodate the non-savvy users. If this is the case, I presume the update queries (etc) are activated by the user clicking a button of some description on a form. If this is the case, then you can toggle the setwarnings in the macro that is linked to the button. However, if you used the wizard to set up the button command then this won't work - it only works with macros assigned to buttons. BTW, I have never turned off the warnings on a global level in my databases - I almost always do it only at the times that I want the warnings turned off.

Did you get the autoexec macro to hide the main database window?

Andrew. :)
 
Upvote 0
Upvote 0
Wow,
Thanks for all the input guys - I need to follow up on Denis' advice re:Shift key at startup, but otherwise I think I've cracked it.

For the sake of anyone else following this thread, I managed to achieve what I wanted by creating a couple of sub-routines to set the said options to false. Then I created a Function procedure to call up the sub's, which in turn could then be called by a Run Code event in the AutoExec.

Thanks again for all the guidance
 
Upvote 0

Forum statistics

Threads
1,221,816
Messages
6,162,149
Members
451,746
Latest member
samwalrus

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top