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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Global Variable

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
I have two forms... what I would like is to to store UserID from the second form asa variable. From the first form I would like to be able to call this variable as necessary.

Could you please give me any help\examples about doing this, keeping it as simple as possible. It's just that all of he examples juts seem to give a little buit of the answer ;o|

Thanks....
 
Go into a module and place a line to "dim" your global variable like so:


Global gvarUserID As String


Now in your forms code you just treat gvarUserID as any variable you would normally use. It can be called anywhere and everywhere, just make sure you set it equal to something so that you can use it. Like so:

gvarUserID = CurrentUser


Hope that helps!
Joe Miller
joe.miller@flotech.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top