Greying Out Controls

J

Jen

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
 
F

fredg

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

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

fredg

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
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]
Thanks everyone,
Jen

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.

What happens if you use:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top