I have a form that shows a date field. When the date field is empty (null),
how can I change the fill color on form to another color. Build expression
for null value?
There are a couple of ways this can be accomplished. One would be to use
Conditional Formatting. In form design mode, select the control you want to
format, and from the menu bar select Formt->Conditional Formatting.
The other would be to use the Form's Current event to set the back color:
If IsNull(Me.MyDateControl) Then
Me.MyDateControl.BackColor = 'Put your color here
End If
> I have a form that shows a date field. When the date field is empty (null),
> how can I change the fill color on form to another color. Build expression
> for null value?
Stu Campbell - 10 Oct 2005 21:37 GMT
I am trying to use conditional formatting and have condition 1 as follows:
field value is; equal to; IsNull;change back fill to read. This is not
working. How do I complete this using conditional formatting?

Signature
SAC
> There are a couple of ways this can be accomplished. One would be to use
> Conditional Formatting. In form design mode, select the control you want to
[quoted text clipped - 7 lines]
> > how can I change the fill color on form to another color. Build expression
> > for null value?
Klatuu - 10 Oct 2005 21:57 GMT
IsNull is a function, not a value. I did try field value is; equal to; Null
and that did not work. I also tried field value is; equal to; "" and that
did not work either.
It would probably work better if you use the other method I posted earlier.
> I am trying to use conditional formatting and have condition 1 as follows:
> field value is; equal to; IsNull;change back fill to read. This is not
[quoted text clipped - 11 lines]
> > > how can I change the fill color on form to another color. Build expression
> > > for null value?
Stu Campbell - 10 Oct 2005 22:57 GMT
I do not have the knowledge to create color change on form through Current
Event. Can you walk me through the process or suggest another solution via
conditional formating.

Signature
SAC
> IsNull is a function, not a value. I did try field value is; equal to; Null
> and that did not work. I also tried field value is; equal to; "" and that
[quoted text clipped - 16 lines]
> > > > how can I change the fill color on form to another color. Build expression
> > > > for null value?
Klatuu - 10 Oct 2005 23:25 GMT
Open your form in design mode.
Click on the Properties icon on the menu bar
Select Form in the combo box at the top of the Properties dialog
Select the Events tab
Click in the text box for On Current
Click the icon at the right with the 3 periods ...
Select Code Builder
Paste the following code:
If IsNull(Me.MyDateControl) Then
Me.MyDateControl.BackColor = vbRed
End If
Then to complete the process so that it goes back to the normal color after
a date is entered, Do the same as above except that instead of On Current,
select After Update and paste in this code:
If IsNull(Me.MyDateControl) Then
Me.MyDateControl.BackColor = vbRed
Else
Me.MyDateControl.BackColor = vbWhite
End If
> I do not have the knowledge to create color change on form through Current
> Event. Can you walk me through the process or suggest another solution via
[quoted text clipped - 20 lines]
> > > > > how can I change the fill color on form to another color. Build expression
> > > > > for null value?
Stu Campbell - 11 Oct 2005 14:33 GMT
This worked. One more question on another date field I want a default value
of 00/00/0000. How can I do this.

Signature
SAC
> Open your form in design mode.
> Click on the Properties icon on the menu bar
[quoted text clipped - 43 lines]
> > > > > > how can I change the fill color on form to another color. Build expression
> > > > > > for null value?
Klatuu - 11 Oct 2005 14:40 GMT
This you can't do. It is an invalid date and will cause errors.
> This worked. One more question on another date field I want a default value
> of 00/00/0000. How can I do this.
[quoted text clipped - 46 lines]
> > > > > > > how can I change the fill color on form to another color. Build expression
> > > > > > > for null value?
Stu Campbell - 11 Oct 2005 14:53 GMT
Using your coding inside a report I get a compile error. It can't find
.MyDateControl. Any thoughts

Signature
SAC
> This you can't do. It is an invalid date and will cause errors.
>
[quoted text clipped - 48 lines]
> > > > > > > > how can I change the fill color on form to another color. Build expression
> > > > > > > > for null value?
Klatuu - 11 Oct 2005 15:03 GMT
Yes, the naming I used was just for example purposes. You need to change the
literal .MyDateControl to whatever the name of the text box is where you
enter the date. If you have already done that, then it is a reference
problem. If you are referencing a control on a form from within a report,
you have to fully qualify the name.
forms!PutYourFormNameHere!PutYourDateControlNameHere
> Using your coding inside a report I get a compile error. It can't find
> .MyDateControl. Any thoughts
[quoted text clipped - 51 lines]
> > > > > > > > > how can I change the fill color on form to another color. Build expression
> > > > > > > > > for null value?