Report VBA change time after 14 days

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i am new to VBA
I need the date in a field to change to red when it is 14 day old can this
be done?
I tryed using the =now() but no luck

If Me.txtdate > =Now() Then
Me.txtdate.ForeColor = 255
Else
Me.txtdate.ForeColor = 0
End If
octet
 
Using Now() compares to today's date/time.

Using Date() compares to today's date.

If you want to compare to 14 days BEFORE today's date, you might try:

If Me!txtDate < Date() - 14 Then

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
works great thanks

Jeff Boyce said:
Using Now() compares to today's date/time.

Using Date() compares to today's date.

If you want to compare to 14 days BEFORE today's date, you might try:

If Me!txtDate < Date() - 14 Then

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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

Back
Top