-
Hi can anybody help me..
I'm trying to take a date from a text file,
put it into a variable varExpiryDate, and compare the
ExpiryDate with the varDateNow variable..
If varDateNow >= varExpiryDate Then
MsgBox "This Program has reached the end of its time
limit."
End
End If
the previous code works if I manually put in the date instead of the variable varExpiryDate, #12/4/00#
The code to find the date is something like this
If InStr(TextLine, 1) = #12/5/00# Then
varExpiryDate = #12/5/00#
Call TimeLimit
End If
the date in the text file is written 12/5/00
if anyone can help I would be most grateful.
cheers
skat
-
-
I hate messing around with dates, so I usually revert to using Day(), Month() and Year() functions.
If you don't want to separate the dat into days, months and years for comparision purposes, try:
Code:
varExpiryDate = Format(txtOriginalDate, 'dd/mm/yy')
I don't know what date format your textual expiry date is in. You may even have to resort to using Left, Mid and Right functions to get the day month and year, and concatenate together agin using DateSerial()
Hope this helps...
-
thanks
Thanks for the help guys, I'll give them a shot and see how I get on.
thanks
skat