Avatar of Murray Brown
Murray Brown
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Access VBA test if today is past a certain date

Hi. I want touse Access VBA code to check if today is past a certain date that I have specified
Will the following work?

        Dim oDate as date

        oDate = "31 Dec 2019"
       
        If DateDiff("d", oDate, Now()) >= 0 Then
            MsgBox "Your 30-day  trial period has expired.
        End If
VBA

Avatar of undefined
Last Comment
Murray Brown

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Noah

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
SOLUTION
Norie

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Peter Chan

Use way like (in Access)

    If Me.dueDateTxt < Me.ShippedDate Then
    If CDate(startDate) < CDate(endDate) Then        
    If Format(startDate, "mm/dd/yyyy") < Format(endDate, "mm/dd/yyyy") Then
    If DateDiff(d, startDate, endDate) > 0 Then

Open in new window

   
to compare dates.
Murray Brown

ASKER
thanks very much
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23