Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations dencom on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Point to a field on another form

Status
Not open for further replies.

mauricionava

Programmer
Jul 8, 2005
209
US
Hi, I have a login form that when you login it opens another form to do the entries. The login form remains open. How do I call the userid field from the login form to say in my main form "if userid.value = XXX then enable these buttons" ?

Thanks!

Any suggestions please comment
 
forms!formname!controlName

however you might consider using global variables, then you wouldn't have to keep the login form open...

--------------------
Procrastinate Now!
 
Can you explain a litle of global variables to me? please.

Thanks
 
Local variables:
Declared in any event, subroutine, or function with the keywords Dim or Static. These variables only exist within the context of the procedure in which they are declared. There is no problem with having local variables in many procedures with the same name. They all will refer to different storage spaces. If there is a conflict in names between a local variable and a more global variable, the local variable always wins. Use Static only if you don't want to lose the value in a local variable between calls to the procedure. Usually you will use Dim.

Module-level variables:
Declared in a form or BASIC module's General Declarations section, with the keywords Dim or Private. Dim is the old syntax; Private is preferred. These variables are accessible from any event, subroutine, or function procedure in the module.

old: Global variables:
Declared in any Basic Module in the project using the keyword "Global". These variables can be accessed and changed by any procedure in the project. It's best to avoid these and use the new "Public" type.

new: Public variables:
These are declared in a form or BASIC module's General Declarations section. They belong to the module in which they are declared, but they can be accessed from any procedure in the project. More about these in a later lesson...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top