Results 1 to 4 of 4

Thread: expiration

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    98
    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

  2. #2
    Hyperactive Member
    Join Date
    Nov 1999
    Location
    Galway, Ireland
    Posts
    316
    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


    Slan

  3. #3
    Hyperactive Member
    Join Date
    Jul 2002
    Location
    Canada
    Posts
    455
    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.

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Posts
    98
    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.

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