Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Greying Out Controls

0 views
Skip to first unread message

Jen

unread,
Jan 5, 2010, 10:22:01 AM1/5/10
to
Hi Guys,
I'm trying to get a control on a form to become greyed out when i tick a
check box.I know there's been a couple of threads on this before and i've
actually got it to work but when i open the form again the control is no
longer greyed out, even though the checkbox still has the check mark in it ??

Any help would be great,
Thanks everyone,
Jen

fredg

unread,
Jan 5, 2010, 1:45:25 PM1/5/10
to

It would have been helpful for you to let us know what your code
actually is to "grey out" the control, so as not to just tell you to
do the same thing as is now not working.

The following should work.
You need top place the below code in 2 places.
Place this code in the Check Box AfterUpdate event as well as the
Form's Current event:

Me.[ControlName].Enabled = (Me.[CheckBoxName] = 0)

Substitute your actual control names.

--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail

Jen32

unread,
Jan 5, 2010, 2:24:42 PM1/5/10
to
Hi Fred,
Thanks for the reply. I tried your suggestion and it worked fine in the
AfterUpdate event of the check box, but when i put it the the Form's current
event and run it i get a message saying 'Run-time Error 94;' Invalid use of
Null.

Then when i click Debug i get the following code highlighted in yellow

Me.[Manager].Enabled = (Me.[Check39] = 0)

I tried this code with the square brackets in and out and neither worked

Thanks,
Jen

fredg wrote:
>> Hi Guys,
>> I'm trying to get a control on a form to become greyed out when i tick a

>[quoted text clipped - 5 lines]

fredg

unread,
Jan 5, 2010, 2:44:32 PM1/5/10
to

What happens if you use:

Me.[Manager].Enabled = (Nz(Me.[Check39] ,0)= 0)

Jen32

unread,
Jan 5, 2010, 3:46:55 PM1/5/10
to
That seems to have done the job Fred thanks...the form is displaying the
control as greyed out when i open it again. There's one other small thing
(typical woman i know !)....i've got a report based on that form which
displays the list of managers names down the left hand side and the relevant
info opposite. When i run the report, all the managers names are greyed out
instead of just the one i selected. Is it possible just to have the one i
selected or is it more trouble than it's worth ?

Thanks again,
Jen

fredg wrote:
>> Hi Fred,
>> Thanks for the reply. I tried your suggestion and it worked fine in the

>[quoted text clipped - 29 lines]

0 new messages