Enable/Disable Control Buttons

Hi

I have a number of control buttons and tabs on a main form which I
would like to be disabled until a selection is made in a list box,
after which the controls would be enabled. All of the controls display
data or run reports which require a parameter which is passed to the
underlying queries from aforementioned list box.....I would be
gratefull if someone had a tidy way of achieving this..

Thanks


Steve
Steve_s [ Mi, 26 Juli 2006 17:27 ] [ ID #1405797 ]

Re: Enable/Disable Control Buttons

on the Load event of the form:
me.control1.visible = false
me.control2.visible = false
etc...

on the AfterUpdate event of the list box:
me.control1.visible = true
me.control2.visible = true
etc..

You could also use "enabled" rather than "visible" if you'ld rather do
that, but I think it looks a little slicker to have them appear and
disappear.

Steve_s wrote:
> Hi
>
> I have a number of control buttons and tabs on a main form which I
> would like to be disabled until a selection is made in a list box,
> after which the controls would be enabled. All of the controls display
> data or run reports which require a parameter which is passed to the
> underlying queries from aforementioned list box.....I would be
> gratefull if someone had a tidy way of achieving this..
>
> Thanks
>
>
> Steve
manningfan [ Mi, 26 Juli 2006 19:27 ] [ ID #1405805 ]

Re: Enable/Disable Control Buttons

Thanks very much...works very well with command buttons though the tab
controls can still be selected if I use the enabled option, though the
actual list boxes etc on the tab are dimmed out...So I have used
enabled for controls on the main form and visible for the tabs...looks
very effective!


Thanks again

Steve


ManningFan wrote:
> on the Load event of the form:
> me.control1.visible = false
> me.control2.visible = false
> etc...
>
> on the AfterUpdate event of the list box:
> me.control1.visible = true
> me.control2.visible = true
> etc..
>
> You could also use "enabled" rather than "visible" if you'ld rather do
> that, but I think it looks a little slicker to have them appear and
> disappear.
>
> Steve_s wrote:
> > Hi
> >
> > I have a number of control buttons and tabs on a main form which I
> > would like to be disabled until a selection is made in a list box,
> > after which the controls would be enabled. All of the controls display
> > data or run reports which require a parameter which is passed to the
> > underlying queries from aforementioned list box.....I would be
> > gratefull if someone had a tidy way of achieving this..
> >
> > Thanks
> >
> >
> > Steve
Steve_s [ Do, 27 Juli 2006 17:06 ] [ ID #1407279 ]
Datenbanken » comp.databases.ms-access » Enable/Disable Control Buttons

Vorheriges Thema: ActiveX controls Browse for Folder Dialog
Nächstes Thema: appointment dates problem