BackColor

  • Thread starter Thread starter Greta
  • Start date Start date
G

Greta

I have a form with date fields. If no date is entered I
want the BackColor to be gray. Does anyone know how to do
that?
Thanks,
Greta
 
Hi Fred,
Actually it's Access 2002...and there's no IsNull, that I
could find, in the Conditional Formating dropdown.
I'm still building a form in Design View and will try the
code.
Thanks!
Greta
-----Original Message-----
Greta,
Yes. And No. It depends.

What version of Access?
Continuous Form view?
Single Form View?
Form Datasheet View?

For Access 2000 and later, you can set the control's
Conditional Formatting property.

Set the Condition 1 drop-down box to
IsNull([ThisfieldName])
Select the color from the color selection tool button.

For Access 97 this built-in formatting is not available for continuous or
form datasheet view.

For Single Form view, you can code both the Form's Current event and the
DateField's after Update event:

If IsNull([DateField]) Then
[DateField].BackColor = 12632256 'Gray
Else
[DateField].BackColor = vbWhite
End If


Take a look at
http://www.lebans.com
and see if he has something for Access 97 continuous and form datasheet
view.
--
Fred

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


Greta said:
I have a form with date fields. If no date is entered I
want the BackColor to be gray. Does anyone know how to do
that?
Thanks,
Greta


.
 
Greta,
Ooops. I left that part out. Sorry

In the Condition1 drop-down there are 3 choices.
Field Value Is
Expression Is
Field Has Focus

Select
Expression Is

Then, alongside the drop-down, there is a text box for you to write the
expression.
Write in that text box:
IsNull([ThisfieldName])

Change 'ThisfieldName' to what ever the actual date field name you are using
is.

--
Fred

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


Greta said:
Hi Fred,
Actually it's Access 2002...and there's no IsNull, that I
could find, in the Conditional Formating dropdown.
I'm still building a form in Design View and will try the
code.
Thanks!
Greta
-----Original Message-----
Greta,
Yes. And No. It depends.

What version of Access?
Continuous Form view?
Single Form View?
Form Datasheet View?

For Access 2000 and later, you can set the control's
Conditional Formatting property.

Set the Condition 1 drop-down box to
IsNull([ThisfieldName])
Select the color from the color selection tool button.

For Access 97 this built-in formatting is not available for continuous or
form datasheet view.

For Single Form view, you can code both the Form's Current event and the
DateField's after Update event:

If IsNull([DateField]) Then
[DateField].BackColor = 12632256 'Gray
Else
[DateField].BackColor = vbWhite
End If


Take a look at
http://www.lebans.com
and see if he has something for Access 97 continuous and form datasheet
view.
--
Fred

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


Greta said:
I have a form with date fields. If no date is entered I
want the BackColor to be gray. Does anyone know how to do
that?
Thanks,
Greta


.
 
Hey, it worked!!
Thanks!
Greta
-----Original Message-----
Greta,
Ooops. I left that part out. Sorry

In the Condition1 drop-down there are 3 choices.
Field Value Is
Expression Is
Field Has Focus

Select
Expression Is

Then, alongside the drop-down, there is a text box for you to write the
expression.
Write in that text box:
IsNull([ThisfieldName])

Change 'ThisfieldName' to what ever the actual date field name you are using
is.

--
Fred

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


Greta said:
Hi Fred,
Actually it's Access 2002...and there's no IsNull, that I
could find, in the Conditional Formating dropdown.
I'm still building a form in Design View and will try the
code.
Thanks!
Greta
-----Original Message-----
Greta,
Yes. And No. It depends.

What version of Access?
Continuous Form view?
Single Form View?
Form Datasheet View?

For Access 2000 and later, you can set the control's
Conditional Formatting property.

Set the Condition 1 drop-down box to
IsNull([ThisfieldName])
Select the color from the color selection tool button.

For Access 97 this built-in formatting is not available for continuous or
form datasheet view.

For Single Form view, you can code both the Form's Current event and the
DateField's after Update event:

If IsNull([DateField]) Then
[DateField].BackColor = 12632256 'Gray
Else
[DateField].BackColor = vbWhite
End If


Take a look at
http://www.lebans.com
and see if he has something for Access 97 continuous
and
form datasheet
view.
--
Fred

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


I have a form with date fields. If no date is entered I
want the BackColor to be gray. Does anyone know how
to
do
that?
Thanks,
Greta


.




.
 
Back
Top