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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Testing for a toolbar button being pushed.

Status
Not open for further replies.

AcousticalConsultant

Technical User
Sep 20, 2001
45
CA
I'm trying to figure out how to know when a specific button has been pushed on a toolbar. The reason for this is that if I open my document containing macros manually, it will display a message (instructions). However, if the user pushes a toolbar button associated with the document, I don't want the message to show up. So how do I know if the button has been pushed or not? I have tried several things, this seems to be the closest:

If (CommandBars("myBar").Controls(1).Enabled = true) Then
.
.
.
End If

But that line always returns "True" not matter what I do. Even if the toolbar is turned off (not visible).

Please help!

Thanks a lot!
 
I think what you are doing here: *If (CommandBars("myBar").Controls(1).Enabled = true) Then* is verifying if the Control is Enable or Disable from the toolbar so if it is enable by default it returns True always, not if is pushed.

Post more information.

What kind of document are you tying to Open?
What Macros do you have?

Best Regards

---
JoaoTL
mail@jtl.co.pt
MS Access Site: The Page: moved to
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top