Link to home
Start Free TrialLog in
Avatar of Wilder1626
Wilder1626Flag for Canada

asked on

VB6 - Message to pop up 3 month before January 1 of the flowing year

Hi,

How can i create a msgbox that will pop up 3 months before the following January 1st of every years?

the msgbox can say "January 1 will be in 3 months"


thanks for your help
Avatar of Wilder1626
Wilder1626
Flag of Canada image

ASKER

So far, i did it this way but i think there is a better way to do it for sure:
Dim Date1 As Date
    Dim Date2 As Date

    Date1 = Now
    Date2 = DateSerial(Year(Date) + 1, 1, 1)

    Text1 = DateDiff("d", Date1, Date2)
    If Text1 <= "90" Then
        MsgBox "January 1 will be in 3 months"
    End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oops cross-posted. Your code will do just as well.
Thanks for your help.

It works, i will use your option.