conditional formatting

C

Claude

Ok so I am lost again! lol
can someone tell me how to use the conditional formatting
to turn a date field in a form "red" when I get to
withing 90 days of the date. I know that conditional
formatting will do it, but I am not sure what to enter
into the boxes of the window?? I know that I need it to
say "field value is greater than or equal to ??????? (i
think I need it to say "value - 90" but I am not sure,
any help would be greatly appreciated

thanks
Claude
 
B

Bish

In a Single Form you can use the On Current event to
conditionally format you field. This event runs each time
a new record is viewed.

Private Sub Form_Current()
If txt_Date.Value < DateAdd("d", 90, Date) Then
txt_Date.ForeColor = 255
Else
txt_Date.ForeColor = 0
End If
End Sub

the above code checks if the value in my textbox control
called txt_Data is less than 90 days from today. If it is
it make the Fore Color property Red (255) or if not then
the Fore Color is Black (0).

The tircky bit is the DateAdd... for more info on this
function enter the code in your form and the press F1 with
the cursor in the word DateAdd. This will oprn the help
file for you.

Hope this helps... Bish
 

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