Conditional formatting

G

Guest

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

strive4peace

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

Guest

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.

strive4peace said:
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.
 
G

Guest

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


TotallyConfused said:
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.

strive4peace said:
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.
 

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