>I wonder when a variable is declared as Public, it is visible
>be all forms, functions and procedures?
>
>I have declared a Public variable in the main module, but when
>I called a form, it doesn't recognised the public variable.
>Pls advise, thanks.
By "Main module", do you mean a standard .bas module? If so, your variable is visible everywhere in your application.
If not:
-Check your spelling.
-Add "Option Explicit" to every module (frm, bas, cls, ...) of your app.
-Check for another variable of the same name with local visibility.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com