Start up Macro Help!

Tyinawyn

Registered User.
Local time
Today, 10:26
Joined
Oct 7, 2015
Messages
19
Hi there,

Have been working on a project for so long that my vision is blurred and im not thinking clearly! Plus I have to split and install my database tomorrow and need help to get over this last hurdle......

I need to make this code run on start up of database:
DoCmd.RunCommand acCmdWindowHide
DoCmd.ShowToolbar "Ribbon", acToolbarNo

I know I need to open with autoexec macro, have created a function and tried to open that way but not working.

HELP!

My plan is to do this, bypass shift key and then have a button within developer log in that reverses the above code.

Does this sound right and will it protect the database?

Thanks for any help through this
 
If you put that code in a public function in a module. and call that function in the AutoExec macro it should work ok. One think that might be messing you up is that when Access autocompletes your function name in the macro it leaves it without a closing parenthesis like

HideStuff(

so make sure that's not a problem. If that's not the problem then please post the complete function code and a screen shot of your autoexec macro.
 
Thanks so much!

further forward although now its saying
the command or action "window hide" is not available now.

I have hidden nav panel, turned off all menu options.

I have a login form that opens on start....

Any ideas?

Cheers
 
Edited: See next post

Try putting
Code:
DoCmd.SelectObject acTable, , True

before

Code:
DoCmd.RunCommand acCmdWindowHide
DoCmd.ShowToolbar "Ribbon", acToolbarNo

I think the DoCmd.RunCommand acCmdWindowHide needs the focus to be on something in the window. I'm assuming you have a least a table there.
 
Last edited:
On the other hand if you have the navigation turned off in the options why to you need to hide it? Maybe you can't hide it if it's already hidden.
 
Hi again

my reason for doing this is to get rid of the privacy options from file menu.

I don't wont users being able to turn navigation back on and have access to the structure tables etc.

Is there a better way of doing this?

Thanks :-)
 
That worked, put focus on login form.

amazing thanks

one last thing, I will sleep a lot better with this, but can I attach code to a button in an area only I can get to, to turn these back on?

so grateful x
 
strange though

navigation wont go now no matter what I set it to
hmmm
 
That worked, put focus on login form.

amazing thanks

one last thing, I will sleep a lot better with this, but can I attach code to a button in an area only I can get to, to turn these back on?

so grateful x

I don't know about that. I suggest you post a new thread with that question. In your post tell what you got so far and want you want
 

Users who are viewing this thread

Back
Top Bottom