i have some problem

  • Thread starter Thread starter grabeva
  • Start date Start date
G

grabeva

i define an string variable, it use in module form, and initialic
there. when de form is unload, this variable loose the value, why?
someone help me?????
thanks....
 
It all depends on how you called the variable. There are
four types, Dim, Public, Private and Static. You can also
declare them either at procedure level or module level in
the options section of the module (top of the module).
Each retains the value for different times.

Have a look under the help variables to see how each can
be used.

Static should retain the value between calls, whilst Dim
defiend at procedure level looses its value when that
procedure ends. Declaring a variable at module level as
Public should retain the value after the form has closed.

Make sure though that the variable is decalred in a module.

Best of Luck
DavidC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top