Results 1 to 7 of 7
  1. #1
    Star Lounger
    Join Date
    Jun 2004
    Location
    Lambertville, New Jersey, USA
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts

    need to empty a date memory variable (2002)

    I have a memory variable defined as a date. Sometimes it will contain a valid date based on the current record processing. At other times I need to "blank" it out but I'm not able to do so. Is there some function or some way to reinitialize it to empty/null without re-dimming it?

    Thanks,
    Lance

  2. #2
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: need to empty a date memory variable (2002)

    Why would you want to?

    What do you mean by redimming?

    Why not use another variable to denote if the date is applicable or not?

  3. #3
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: need to empty a date memory variable (2002)

    Does it work if you just write

    dtMydate = Null

    where dtMydate is your variable.
    Regards
    John



  4. #4
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: need to empty a date memory variable (2002)

    I had tried that already as well as setting the date field to "" and neither worked, it resulted in a run time error.

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: need to empty a date memory variable (2002)

    I remember now!

    The only variables you can set to Null are Variants.

    In this case try defining your variable as a Variant rather than a Date.
    Regards
    John



  6. #6
    Platinum Lounger
    Join Date
    Dec 2001
    Location
    Melbourne, Australia
    Posts
    4,594
    Thanks
    0
    Thanked 27 Times in 27 Posts

    Re: need to empty a date memory variable (2002)

    There you go Lance, John has suggested you define your date field as a variant so you can set it to null.

  7. #7
    Star Lounger
    Join Date
    Jun 2004
    Location
    Lambertville, New Jersey, USA
    Posts
    82
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: need to empty a date memory variable (2002)

    Pat, John; Thanks to both of you. I'll give the variant approach a shot. It you can set a variant to Null, then it should work.

    Thanks again,
    Lance

Posting Permissions

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