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

Newbie... How do I pull reference data stored in a module?

Status
Not open for further replies.

Toby3652

Technical User
Jul 3, 2008
2
US
Newbie to VB here.
I have a module in a dbase that stores the user id of the person logged into the dbase.
In the logon screen, I set the value of the user id using the following codes.

lngCurrentUser = Me.UserName.Value

lngCurrentUserID = DLookup("ID", "lst_SalesRep", "[forms]![Login_01-Open]![UserName] = [Logon]")

I also created a module in app to store the code for later use (i.e. to filter reports, forms, etc.)

That module is called CrntUser and has the following code:

Public lngCurrentUser As String
Public lngCurrentUserID As Long

Now all I need to do is reference those two values in my forms, reports, etc. Haven't a clue how to do this.

I'm sure the answer is pretty easy, but being a newbie, it's not so easy for me. Also, I'm doing this in Access 2007.
 
you should post this i an access fourm

x=lngCurrentUser .....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top