[AccessD] Ribbon context
Ryan W
wrwehler at gmail.com
Tue Jan 25 11:44:20 CST 2022
The problem is it doesn't contextually change if you change forms with tabs
in the Open/Close events. OnActivate seems like the best place, but let us
say we're in a form where it's deactivated through invalidation and they
open a new form that basically has no requirements to contextually
disable/enable the button. It stays disabled, because the new form was
opened and has NO code to invalidate the ribbon control. So it stays
disabled.
Keeping forms open and using tabs is why I needed to figure out a way to
add the calling code to every single OnActivate event on every form,
nearest I can tell.
On Tue, Jan 25, 2022 at 11:30 AM Rocky Smolin <rockysmolin2 at gmail.com>
wrote:
> If you can disable the button with a line of code and it is needed in a
> dozen forms, then I would take the brute force method - put that disable
> line of code in the open event and put the enable line of code in the Close
> event.
>
> Unless you're saying that ANY form MIGHT need the button depending on some
> condition. In which case you could still do it with a line of code in each
> form calling a public function that would return True/False for
> disabling the delete button.
>
> Unless each form that MIGHT need to have its delete button disabled would
> have differing conditions. In which case...
>
> r
>
>
> On Tue, Jan 25, 2022 at 8:47 AM Ryan W <wrwehler at gmail.com> wrote:
>
> > Well, lets put it this way:
> >
> > All forms need it but only a dozen or so forms that are used frequently
> > that the contextually enabled function would be nice
> >
> >
> > On Tue, Jan 25, 2022 at 10:44 AM Rocky Smolin <rockysmolin2 at gmail.com>
> > wrote:
> >
> > > O. So not ALL forms need the delete button disabled? How many?
> > >
> > > r
> > >
> > > On Tue, Jan 25, 2022 at 8:40 AM Ryan W <wrwehler at gmail.com> wrote:
> > >
> > > > Yes, I could but if the user navigates to another menu via one of the
> > > > AutoKeys buttons I have assigned, I need the delete button to
> > > contextually
> > > > enable/disable itself if they go back to the tab in question, which
> is
> > > why
> > > > the OnActivate event seems like a logical choice, because it kicks
> off
> > > > again if you have the form open and go back to the tab.
> > > >
> > > >
> > > >
> > > > On Tue, Jan 25, 2022 at 10:28 AM Rocky Smolin <
> rockysmolin2 at gmail.com>
> > > > wrote:
> > > >
> > > > > Can you disable the delete button in the Open event of the opening
> > > form?
> > > > > That should keep it disabled for the whole session, no?
> > > > >
> > > > > r
> > > > >
> > > > > On Tue, Jan 25, 2022 at 5:18 AM Ryan W <wrwehler at gmail.com> wrote:
> > > > >
> > > > > > Ahh. Unfortunately I need to use the in place ribbon. As I said
> it
> > > > works
> > > > > > now and the delete button doesn’t succeed due to table
> permissions.
> > > It
> > > > > > would just be a “nice” feature to disable the button to give an
> > > > > indicator.
> > > > > >
> > > > > > Sent from my iPhone
> > > > > >
> > > > > > > On Jan 25, 2022, at 7:07 AM, Gustav Brock via AccessD <
> > > > > > accessd at databaseadvisors.com> wrote:
> > > > > > >
> > > > > > > Hi Ryan
> > > > > > >
> > > > > > > The default ribbon.
> > > > > > >
> > > > > > > /gustav
> > > > > > >
> > > > > > > -----Oprindelig meddelelse-----
> > > > > > > Fra: Ryan Wehler <wrwehler at gmail.com>
> > > > > > > Sendt: 25. januar 2022 13:44
> > > > > > > Til: Access Developers discussion and problem solving <
> > > > > > accessd at databaseadvisors.com>
> > > > > > > Cc: Gustav Brock <gustav at cactus.dk>
> > > > > > > Emne: Re: [AccessD] Ribbon context
> > > > > > >
> > > > > > > Most my users are in runtime mode. They still have the ribbon,
> > what
> > > > am
> > > > > I
> > > > > > missing here ?
> > > > > > >
> > > > > > >> On Jan 25, 2022, at 2:32 AM, Gustav Brock via AccessD <
> > > > > > accessd at databaseadvisors.com> wrote:
> > > > > > >>
> > > > > > >> Hi Ryan
> > > > > > >>
> > > > > > >> You could run the application in runtime mode.
> > > > > > >>
> > > > > > >> /gustav
> > > > > > >>
> > > > > > >> PS: How do you manage typing that amount of text on your
> phone?
> > > > > > >>
> > > > > > >>
> > > > > > >> -----Oprindelig meddelelse-----
> > > > > > >> Fra: AccessD <accessd-bounces+gustav=
> > > cactus.dk at databaseadvisors.com
> > > > >
> > > > > > På vegne af Ryan W
> > > > > > >> Sendt: 25. januar 2022 01:39
> > > > > > >> Til: accessd at databaseadvisors.com
> > > > > > >> Emne: [AccessD] Ribbon context
> > > > > > >>
> > > > > > >> In Access I’m trying to disable some ribbon buttons based on
> the
> > > > form
> > > > > > in question and permissions to delete records on that form.
> > > > > > >>
> > > > > > >> I’ve got the getEnabled logic worked out and it disables the
> > > delete
> > > > > > button on the ribbon when I invalidate the control via the
> > OnActivate
> > > > > event
> > > > > > for the form (so it runs again if the form tab is switched back).
> > > > > > >>
> > > > > > >> My issue is we have hundreds of forms that would need an
> > > OnActivate
> > > > > > event added so the delete button can be contextually controlled.
> > > > > > >>
> > > > > > >>
> > > > > > >> Is there a better way to do this that isn’t a really fast
> timer
> > > > event
> > > > > > or some sort of class for handling that event on all forms (can
> you
> > > > even
> > > > > > instantiate a class object on a closed form?)
> > > > > > >>
> > > > > > >>
> > > > > > >>
> > > > > > >> Right now the delete button always shows but the code behind
> it
> > > will
> > > > > > not succeed if the back end tables don’t grant the permissions,
> it
> > > > would
> > > > > > just be nice to sort of give a visual cue that the action isn’t
> > > > possible.
> > > > > > >>
> > > > > > >>
> > > > > > >> Sent from my iPhone
> > > > > > >> --
> > > > > > > --
> > > > > > > AccessD mailing list
> > > > > > > AccessD at databaseadvisors.com
> > > > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > > > Website: http://www.databaseadvisors.com
> > > > > > --
> > > > > > AccessD mailing list
> > > > > > AccessD at databaseadvisors.com
> > > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > > Website: http://www.databaseadvisors.com
> > > > > >
> > > > > --
> > > > > AccessD mailing list
> > > > > AccessD at databaseadvisors.com
> > > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > > Website: http://www.databaseadvisors.com
> > > > >
> > > > --
> > > > AccessD mailing list
> > > > AccessD at databaseadvisors.com
> > > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > > Website: http://www.databaseadvisors.com
> > > >
> > > --
> > > AccessD mailing list
> > > AccessD at databaseadvisors.com
> > > https://databaseadvisors.com/mailman/listinfo/accessd
> > > Website: http://www.databaseadvisors.com
> > >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > https://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
More information about the AccessD
mailing list