How to get variables from one module to another

bodhran1

Dazed and Confused
Local time
Today, 05:50
Joined
Mar 27, 2002
Messages
43
I'm new at Access and VB, so I need some help.

On a form (called LOGIN), I ask the user for thier name and password.

Then using VB, I open an Excel database that contains user info and confirm the password.

Also contained in that Excel file is their "supervisors name". Lets assign it MGR$ for now.

If I close the Excel file and the VB script, can I get at this variable MGR$ several forms later?

I hope this all makes sense.


Thanks in advance!!!

Dave
 
I would migrate the usernames and passwords into a hidden table in Access. This should simplify things a bit. Once this is done you can lookup the usernames and/or passwords using DLookup.
If you still want to store the values, then use a Public value declared in a common module. The values stored here are available to all modules within the life of the current program instance.

Public gUser as Long
Public gUserName as String

HTH
Chris
 
If you have Access 97 or higher, see Help for "Property procedures".

That's what you want.

RichM
 

Users who are viewing this thread

Back
Top Bottom