Access toolbar Programming (1 Viewer)

xMax

Registered User.
Local time
Today, 13:01
Joined
Aug 7, 2006
Messages
35
I need to know how to make a command button on a toolbar open a form. The code has to work for each and every form I have.
 

xMax

Registered User.
Local time
Today, 13:01
Joined
Aug 7, 2006
Messages
35
I'm still a little confused. I know what the Module does but how do I get to respond to a toolbar-button click event?
 

Pauldohert

Something in here
Local time
Today, 10:01
Joined
Apr 6, 2004
Messages
2,101
You need to get to the properties of the button and then put code in the ON Action Field.


Have a look at the sample db posted where its alll working togther.
 

xMax

Registered User.
Local time
Today, 13:01
Joined
Aug 7, 2006
Messages
35
Ok, now I have a question about the Application.CommandBars("nameoftoolbar") function.

I have a toolbar with a menu with command buttons inside, sort of like this.


toolbar name is toolbar

A menu on the toolbar is file
on file is changepassword
quit
save

How do I make the changepassword field disabled?

I know this won't work:
Application.CommandBars("toolbar").Controls("changepassword").Enabled = false

This won't work either:

Application.CommandBars("file").Controls("changepassword").Enabled = false

Neither will this:

Application.CommandBars("toolbar").Controls("file").Controls("changepassword").Enabled = false

I need to know what will work.
 

Pauldohert

Something in here
Local time
Today, 10:01
Joined
Apr 6, 2004
Messages
2,101
Application.CommandBars(name).Controls("changepa ssword").Enabled = false


should work - where name is the title at the top of the properties form for button changepassword
 

Users who are viewing this thread

Top Bottom