I have a form that I need to add some conditional formatting. I have a date
field contingent on two other fields. How do I write for the expression - If
field 1 is null than field 2 is greyed out.? Thank you for any help.
When you say "greyed" out, if you mean Disabled, then you cannot do this
with conditional Formatting, you need to use:
form Current event to set when the record changes
AND
control AfterUpdate event for control this is based on
'~~~~~
dim mBoo as boolean
mBoo = IIF(isnull(me.controlname1), false, true)
me.controlname2.enabled = mBoo
'~~~~~
if you just mean that the color is gray, then
1. select control to change color of
2. from menu: Format, Conditional Formatting
Expression is --> If isnull([controlname])
choose gray foreground color
Warm Regards,
Crystal
*
(: have an awesome day :)
*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*
> I have a form that I need to add some conditional formatting. I have a date
> field contingent on two other fields. How do I write for the expression - If
> field 1 is null than field 2 is greyed out.? Thank you for any help.
TotallyConfused - 15 Mar 2007 22:11 GMT
I am sorry I meant If it is NOT null - how do I write it. I tried
IF(IsNotNull([CONTROL NAME])) not working. This is in FORMAT, Cconditional
Formatting.
Thank you.
> When you say "greyed" out, if you mean Disabled, then you cannot do this
> with conditional Formatting, you need to use:
[quoted text clipped - 29 lines]
> > field contingent on two other fields. How do I write for the expression - If
> > field 1 is null than field 2 is greyed out.? Thank you for any help.
scubadiver - 16 Mar 2007 14:03 GMT
Insert one of the following in the "after update" event and Replace FIELD1
and FIELD2
If me.FIELD1 = Null then me.FIELD2.enabled = false
or
If me.FIELD1 is Null then me.FIELD2.enabled = false
> I am sorry I meant If it is NOT null - how do I write it. I tried
> IF(IsNotNull([CONTROL NAME])) not working. This is in FORMAT, Cconditional
[quoted text clipped - 35 lines]
> > > field contingent on two other fields. How do I write for the expression - If
> > > field 1 is null than field 2 is greyed out.? Thank you for any help.