Shading Rows in a Form

D

djf

I have a form in datasheet view. I would like to shade specific rows based on
the value of a certain field.

I have a field named Complete Date, if this field is not null I want the
entire row shaded in gray.
 
J

John W. Vinson

I have a form in datasheet view. I would like to shade specific rows based on
the value of a certain field.

I have a field named Complete Date, if this field is not null I want the
entire row shaded in gray.

Open the form in design view and select Format... Conditional Formatting.
 
F

FatMan

DJF:
I am sure there are others on here that are far better than I in access and
could answer you post with a much more cleaver and better solution than I but
here is my attempt at an answer.

What you would need to do is change the back color or each field in the row
when you complete date is not null. What you could try is entering code
similar to the below in the after update event of the complete date field.

If CompleteDate <> ҠThen
Me.FieldName1.BackColor = 12632256
Me.FieldName2.BackColor = 12632256
Me.FieldName3.BackColor = 12632256
Me.FieldName4.BackColor = 12632256
Me.FieldName5.BackColor = 12632256
Else
Me.FieldName1.BackColor = -2147483643
Me.FieldName2.BackColor = -2147483643
Me.FieldName3.BackColor = -2147483643
Me.FieldName4.BackColor = -2147483643
Me.FieldName5.BackColor = -2147483643
End if

This would cause the back color of fieldname1 to fieldname5 to change to
gray when some one changes the date from null and leave it white if the value
is null.


Hope this helps,
FatMan
 

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