PC Review


Reply
Thread Tools Rate Thread

access 2007 ribbon - disable button on click

 
 
Guest
Posts: n/a
 
      17th Jul 2008
Hi everyone,
I use one ribbon for navigation through the different areas of the db, and
the ribbon it is selected in "properties > other > ribbon" of every form
involved.
my question is: how do i disable a button, after i click on it (which means:
when i am currently viewing a form, i would like the button related to it to
turn disabled)?

My current xml code is as follows:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"
onLoad="CallbackOnLoad">
<ribbon startFromScratch="true">
<tabs>
<tab id="naviID" label="promotecDB">
<group id="navi2ID" label="Rubrica">
<button id="RUBCLIENTI" label="Clienti" size="large"getImage
="getMyImage" getEnabled="disableXxx" onAction="openRubClienti"/>
<button id="RUBAGENTI" label="Agenti" size="large" getImage
="getMyImage" getEnabled="disableXxx" onAction="openRubAgenti"/>
<button id="RUBRECAP" label="Recapiti" size="large" getImage
="getMyImage" getEnabled="disableXxx" onAction="openRubRecap"/>
</group>
....

I know i have to set the "CallbakOnLoad" and "disableXxx" related to the
pressed button somehow, and afterwards to invalidate the ribbon in order to
refresh it, but don't know how to do that.
I've been searching in newsgroups for my problem, but all my attempts didn't
produce the expected results.

Could you plase give me some advice on this issue?
Thank you so much for your help!
em.an.

 
Reply With Quote
 
 
 
 
Albert D. Kallal
Guest
Posts: n/a
 
      18th Jul 2008
>getEnabled="disableXxx

You have to make a public function in which it returns true/false.

so,

Public Function disablebt1

disable = gblBt1

end if


then in code, you go:

gblBt1 = false
ribbon refresh command goes here....

Now, if you think about the above, that means for every button you need to
enable/disable you have to write a public function and declare a variable.
that is too much work....

A better solution is my ribbon class system that allows you to go:

MyEnable("ribbonName").Contorls("Name of contorl").Enabled = true/false

You can find my example code here:

http://www.members.shaw.ca/AlbertKal.../msaccess.html
Access 2007 ribbon code enable/disable example

I not had the time to document the code..but take a quick look at the sample
form.


--
Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada
(E-Mail Removed)



 
Reply With Quote
 
Guest
Posts: n/a
 
      21st Jul 2008
"Albert D. Kallal" <(E-Mail Removed)> ha scritto nel messaggio
news:(E-Mail Removed)...
> >getEnabled="disableXxx

>
> You have to make a public function in which it returns true/false.
>
> so,
>
> Public Function disablebt1
>
> disable = gblBt1
>
> end if
>
>
> then in code, you go:
>
> gblBt1 = false
> ribbon refresh command goes here....
>
> Now, if you think about the above, that means for every button you need to
> enable/disable you have to write a public function and declare a variable.
> that is too much work....
>
> A better solution is my ribbon class system that allows you to go:
>
> MyEnable("ribbonName").Contorls("Name of contorl").Enabled = true/false
>
> You can find my example code here:
>
> http://www.members.shaw.ca/AlbertKal.../msaccess.html
> Access 2007 ribbon code enable/disable example
>
> I not had the time to document the code..but take a quick look at the
> sample
> form.
>
>
> --
> Albert D. Kallal (Access MVP)
> Edmonton, Alberta Canada
> (E-Mail Removed)
>


I'll definite look at your suggestion.
Thank you so much Albert!
em.an.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
IDBE Ribbon Creator for Access 2007 ribbon customization dbguyatlanta Microsoft Access 8 1st Mar 2011 11:59 PM
Enable/Disable button in a Word 2007 custom Ribbon AllusiveKitten General Software 0 25th Nov 2010 01:06 AM
Re: Disable button on custom ribbon Tom van Stiphout Microsoft Access VBA Modules 2 27th May 2010 10:23 PM
Access 2007 No Switch Windows Button on Ribbon Tanya Microsoft Access 1 2nd May 2008 03:23 PM
Outlook 2007 Click a Button on the Ribbon through Code n777krish@gmail.com Microsoft Outlook Program Addins 5 14th Dec 2006 08:04 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:55 PM.