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.
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.