Thread: Greyout Fields
View Single Post
  #7  
Old May 11th, 2004, 08:06 PM
Corrina
external usenet poster
 
Posts: n/a
Default Greyout Fields

Just use "If" in the code to specify whether to disable/hide or enable/show the control. In a check box, the value of a check is -1 and no check (white) is 0. (If the check box is grey, it has a null value.) The visual basic code for the After Update Event would look something like this:

If [checkbox]=-1 Then
(code to enable/show)
ElseIf [checkbox]=0 Then
(code to disable/hide)
End If

Corrina Burnley
Burnley Data Solutions
www.burnleydatasolutions.com

----- John Green wrote: -----

Thanks For your help
but how do I get the field to return to a disabled state
when the tick is removed say in the case of an error
-----Original Message-----
John,
We've all had that "first time."
I will assume that when you speak of a "tick" in another

field, that you are using either a checkbox or an option
button. In either case, you will need some code added to
the "AfterUpdate" event of your checkbox or option button
or, for that matter, what ever control you are using.
The "grey out" is refered to as disabled. So the control

is either enabled or disabled.
The code would be like:
to disable the control use:

Me.TheNameOfTheControlToBeDisabled.Enabled = False
to hide the control use:

Me.TheNameOfTheControlToBeDisabled.Enabled = True
HTH
Byron
-----Original Message-----
Hello,
I am trying to create database for the first time, and
one of the things I need it to do is to hide or geayout
some of the fields dependant on a tick being places in
anouther field.
Dose anybody know how this can be done ???
If so Please Help
Thanks

John
.
.