Results 1 to 4 of 4

Thread: expiry date....help!

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Dec 2000
    Posts
    31
    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

  2. #2

  3. #3
    Fanatic Member Gaffer's Avatar
    Join Date
    Nov 2000
    Location
    London
    Posts
    828
    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...

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Dec 2000
    Posts
    31

    thanks

    Thanks for the help guys, I'll give them a shot and see how I get on.
    thanks
    skat

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width