-
i have a very simple question about dates: i want my program to expire after a certain date. i tried using this code:
Code:
If Date >= "4/25/00" Then
'some code
this doesn't work. could anyone give me any pointers on how to make a program expire? thanks a lot.
michael
-
use now instead
eg
if year(now) > = 2000 and month(now) >=4 then
msgbox("Expired")
endif
you can use day as well if you want.
otherwise
dim expiry as date
expiry = "#04/04/2000#
if expiry > date then
endif
-
Hello Michael,
I do think when you place the code:
MsgBox Date
the answer is: "4/4/2000"
use:
If Date >= "4/25/2000" Then'some code
Nice regards,
Michelle.
-
thanks a lot guys. i knew i was doing something wrong and i knew it was probably the simplest thing. well i was right. or wrong...as it is. :) i forget i needed the "#" on each side of the date and not the quotes to make it work. it works beautifully now. thanks again for your help.