Somebody can tellme how can I use a Public Variable declared in main.prg to use in all forms in an application
Actually, I want to check a Password to assign diferent access to
change data or only for consulting. Declaring Public in Main seems not
have effect in forms.
Thank you

Public Variables
Mats Upptrom
You might want to do this creating a property of the _screen object...
_screen
.AddProperty("UserSecurityLevel", 1)This way you can reference it through out your application such as...
if _screen.UserSecurityLevel > 0
*!* Allow the user to do something
endif
I've simplified this considerably here just to give you the idea. You could enhance this greatly by creating a custom class that represents a user in your system and then save all properties of the user in an instance of that class. This object could be added to the _screen or _vfp system objects as well so that it would be accessible throughout your application without the need or dangers of creating a Public variable in your application.
Kevent
Can you confirm that your main program contains a READ EVENTS command
Jenssa
Declaring Public in Main seems not have effect in forms.
As Dan has told you, any public variables declared in your main statrup program will be visible to anything that that is called from it. As a matter of fact, they will exist and be visible to everything in your environment until you either quit VFP or specifically RELEASE them.
A better solution would be to devlare these variables as PRIVATE in your main startup program. Private variables are visible in the procedure in which they are declared and anything else that is called by it. So, when they are declared as PRIVATE in your main startup program, they behave just as if they were declared as PUBLIC with one big advantage: they clean up after themselves when the main program ends.
Of course, this is irrelevant in an exe, but it can have consequences when you are working in the development environment.