Assessing toolbar property

  • Thread starter Thread starter SF
  • Start date Start date
S

SF

I have a combo that display optional action for a listbox on the same form.
A have a toolbar with two bottum that use to select/deselect the items in
the listbox. In some activity, I want to disable these two buttons on the
toolbar. How can I change d property of each toolbar button?

SF
 
Use the click event or the after update event of the control you want to
trigger the action. In an [Event Procedure] use something like the
following:

Sub MyControl_AfterUpdate()
Me.MyButtonName.Enabled = False
Me.MyOtherButton.Enabled = False
End Sub

Use another event such as the form's current event to set them back to True.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access
 
Or in this case

Dim Cbo AS Office.CommandBar 'needs to be added to references ie microsoft
office library

Set Cbo=Access.Commandbars("MyBar")
Cbo("Button1").Enabled=False

Pieter

Arvin Meyer said:
Use the click event or the after update event of the control you want to
trigger the action. In an [Event Procedure] use something like the
following:

Sub MyControl_AfterUpdate()
Me.MyButtonName.Enabled = False
Me.MyOtherButton.Enabled = False
End Sub

Use another event such as the form's current event to set them back to
True.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

SF said:
I have a combo that display optional action for a listbox on the same form.
A have a toolbar with two bottum that use to select/deselect the items in
the listbox. In some activity, I want to disable these two buttons on the
toolbar. How can I change d property of each toolbar button?

SF
 
Or,

Dim Cbo AS object 'doesn't need reference to microsoft office library

Set Cbo=Access.Commandbars("MyBar")
Cbo("Button1").Enabled=False


(david)

Pieter Wijnen said:
Or in this case

Dim Cbo AS Office.CommandBar 'needs to be added to references ie microsoft
office library

Set Cbo=Access.Commandbars("MyBar")
Cbo("Button1").Enabled=False

Pieter

Arvin Meyer said:
Use the click event or the after update event of the control you want to
trigger the action. In an [Event Procedure] use something like the
following:

Sub MyControl_AfterUpdate()
Me.MyButtonName.Enabled = False
Me.MyOtherButton.Enabled = False
End Sub

Use another event such as the form's current event to set them back to
True.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

SF said:
I have a combo that display optional action for a listbox on the same form.
A have a toolbar with two bottum that use to select/deselect the items
in
the listbox. In some activity, I want to disable these two buttons on
the
toolbar. How can I change d property of each toolbar button?

SF
 
Thank for all your useful tips.

SF

david epsom dot com dot au said:
Or,

Dim Cbo AS object 'doesn't need reference to microsoft office library

Set Cbo=Access.Commandbars("MyBar")
Cbo("Button1").Enabled=False


(david)

Pieter Wijnen said:
Or in this case

Dim Cbo AS Office.CommandBar 'needs to be added to references ie
microsoft office library

Set Cbo=Access.Commandbars("MyBar")
Cbo("Button1").Enabled=False

Pieter

Arvin Meyer said:
Use the click event or the after update event of the control you want to
trigger the action. In an [Event Procedure] use something like the
following:

Sub MyControl_AfterUpdate()
Me.MyButtonName.Enabled = False
Me.MyOtherButton.Enabled = False
End Sub

Use another event such as the form's current event to set them back to
True.
--
Arvin Meyer, MCP, MVP
Microsoft Access
Free Access downloads
http://www.datastrat.com
http://www.mvps.org/access

I have a combo that display optional action for a listbox on the same
form.
A have a toolbar with two bottum that use to select/deselect the items
in
the listbox. In some activity, I want to disable these two buttons on
the
toolbar. How can I change d property of each toolbar button?

SF
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top