Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    4

    Question Unanswered: empty a variable? (like unset in php)

    hi all!

    if i dim a variable as

    'Dim LastMonth As Variant'

    i can check with

    'If Not IsEmpty(LastMonth) Then'

    if a value has been given to the variable.


    -> Is there also a way to "unset" (i know this from php) or "reset" the variable LastMonth? This would be helpful as i still can use

    'If Not IsEmpty(LastMonth) Then'

    instead of setting

    'LastMonth = Null' and then check 'If Not IsNull(LastMonth) Then' as i don't know when this variable has received a value.


    thank you very much in advance!
    sphere
    Last edited by sphere; 03-11-04 at 04:21.

  2. #2
    Join Date
    Jan 2004
    Location
    Islamabad, Pakistan
    Posts
    97
    If you defined the variable as variant then you can reset it using

    set variablename = Nothing

    or

    variablename = Empty

    (Nothing and Empty are the reserved keywords in access)

    or

    variablename = ""

  3. #3
    Join Date
    Mar 2004
    Posts
    4
    hi Saqib,

    thanks a lot, that was exactly what i was looking for!

    sphere

Posting Permissions

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