Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...This has been the MOST helpful forum that I have been a part of and I want to say thank you. The tips, tricks and helpful advice that you all contribute to have been lifesavers in many instances..."

Geography

Where in the world do Tek-Tips members come from?

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

Toby3652 (TechnicalUser)
3 Jul 08 11:25
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.
PWise (Programmer)
3 Jul 08 13:18
you should post this i an access fourm

x=lngCurrentUser .....
DaveInIowa (Programmer)
17 Jul 08 12:25
Have you tried using 'CrntUser.lngCurrentUser'?

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close