Re: How to reset global variables to nothing
From: Paul (paul_mak_at_hotmail.com)
Date: 11/09/04
- Next message: Allen Browne: "Re: How to reset global variables to nothing"
- Previous message: Allen Browne: "Re: How to reset global variables to nothing"
- In reply to: Allen Browne: "Re: How to reset global variables to nothing"
- Next in thread: Allen Browne: "Re: How to reset global variables to nothing"
- Reply: Allen Browne: "Re: How to reset global variables to nothing"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 8 Nov 2004 23:19:59 -0800
How about if the variable is the "date" type??
"Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message
news:OtoLVvixEHA.3668@tk2msftngp13.phx.gbl...
> Unlike some languages, VB/VBA sets the initial value of the variable when
> you declare it. Therefore the way to reset it depends on its type.
>
> For numeric types (Integer, Long, Double, Currency, etc), just assign a
> zero:
> MyGlobal = 0
>
> For String types, assign a zero-length string:
> MyGlobal = vbNullString
>
> For Variants, assign the value Empty:
> MyGlobal = Empty
>
> For objects (Form, Control, TextBox, Recordset, etc), set to Nothing:
> Set MyGlobal = Nothing
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Paul" <paul_mak@hotmail.com> wrote in message
> news:%23HBB0ZixEHA.3164@TK2MSFTNGP10.phx.gbl...
>> In a form I store the value of the text box to the global variables in a
>> module. At some point I need to reset those variables in the module to
>> nothing. So I tried the following code in the form event, Set
>> GlobalVariable.Text1 = Nothing or GlobalVariable = vbNullString and both
>> does not work. Thanks.
>
>
- Next message: Allen Browne: "Re: How to reset global variables to nothing"
- Previous message: Allen Browne: "Re: How to reset global variables to nothing"
- In reply to: Allen Browne: "Re: How to reset global variables to nothing"
- Next in thread: Allen Browne: "Re: How to reset global variables to nothing"
- Reply: Allen Browne: "Re: How to reset global variables to nothing"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|