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
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
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