Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / July 2007

Tip: Looking for answers? Try searching our database.

Report VBA change time after 14 days

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Octet32 - 27 Jul 2007 18:38 GMT
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
Jeff Boyce - 27 Jul 2007 18:46 GMT
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

>i am new to VBA
> I need the date in a field to change to red when it is 14 day old can this
[quoted text clipped - 7 lines]
>    End If
> octet
Octet32 - 27 Jul 2007 19:00 GMT
works great thanks

> Using Now() compares to today's date/time.
>
[quoted text clipped - 20 lines]
> >    End If
> > octet
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.