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

CreatedBy

Status
Not open for further replies.

pbrown2

Technical User
Jun 23, 2003
322
0
0
US
Since:
Me!CreatedBy=Environ("username")
returns the username of the system, is there anyway to return the users actual name?
I understan that a table could be created with the usernames and actual names, however with over 4,000 users at one location, that is not pratical.

Unless....
Since we are using Microsoft Outlook which holds each person's username under Alias in their properties.
Is there away to import the addressbook into Access? Therefore, once a week or every other day the data could be imported updating the usernames and actual names.

Or if anyone has any other suggestions of another way to handel this I am extremly open.

Thank you for any and all help,

PBrown
 
What about a Windows registry key? Is there anywhere in your Current User profile that your full name is stored? If so, you can write a module that will call the contents of the registry key.
 
If you are using Acess Security....CurrentUser will work for you...

****************************
Computers are possibly the most un-intelligent things ever invented, yet we let them control the world. Possibly a reflection of our own stupidity.

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Windows Registry Key? That sounds possible, but alittle above my head... Anyway I could check to see if this would work? (Where would I check for this?)


As for Access Security...
I have been warned against access security since there is the potential for so many users. When I first started to design the database, I was told that each user would have to be set up in security and that immediately closed the door on that. Especially since specific users will not be known until a day or two before launch.
If having to input each user is not correct, how hard would it be to implement the security on a database that is rather close to completion then will be split, FE's made to MDE's, compressed and sent to the users via e-mail for them to copy onto their desktop?

Thank you for any and all help,

PBrown
 
There are some automated ways to work security, but you would already need to be quite proficient with it, be VERY comfortable doing VBA coding, and be ready for some serious testing....

That being said, a short term solution would be to create a simple "login" form...opened when the databse opens, and the user can type in thier name. Save this into a global variable or place it into a hidden field somewhere and reference it when necessary. This would not allow for any real security, but you don't seem like you have too much anyway.

To expand on that a bit, you could include a table with username and password, have the splash screen open, they enter name and password, search the user table...if found and match let in....if not found ask if they are new user and enter them into the table. I would include some sort of notice to yourself or a db admin with this system though...But this would allow you to "dynamically" add all the users into the system without your intervention, and once they are added in, no one else can get in with their username.

****************************
Computers are possibly the most un-intelligent things ever invented, yet we let them control the world. Possibly a reflection of our own stupidity.

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Go to your Start menu, and select "Run". Type "regedit" in the Open box to open the Windows Registry Editor.

Select HKEY_Current_User, and hit Ctrl+F to start a Find. Search for any entries with your name as the Data. (F3 cycles to the next entry).

When you find a record that you think all of your users would have in their registry profiles, note its exact path. (i.e., HKEY_Current_User\Software\Microsoft\Office\9.0\Word\Options\ReplyMessageComment) You'll need to specify this when you call it.
 
Thank you AlienRay, however we do not have access to get to the type of file you are refering to.
Therefore, I am attempting to try the "Form" suggested by mstrmage1768. However, I could use some help.
1) Table "tblUsers" has been created with the following fields:
A) UserID (Form text box name = UserID)
B) Last Name (Form name = LName)
C) First Name (Form Name = FName)
D) Clock Number (Form Name = ENum)
2) Form "Users" has been created to house the above fields. Also, an unbound box (EnvironName) has been created and the following written for the on open event of the form

Me!EnvironName = Environ("username")

Where I am stuck is how to have the form check the table via the EnvronName to see if the user is "set up".

I know the below is not correct but I think I am somewhat on target...

Form On Open()

If EnvironName = UserID then
domcd.openform "Switchboard", , , , , ,""
else
msgbox "New User: Complete form to continue"
LName.SetFocus

Would this work? If so, what would be the correct way to word the first part to check the tblUsers? Then before the user could click the "continue" button to run a check to ensure they entered the userID that the computer has in its EnvironName.

Thank you for any and all help,

PBrown
 
You are making things more difficult than they are....

I think you are trying to overanalyze your situation too much. Contact me via my work add below and I will send you a sample that should be close to your needs for you to work with.

****************************
Computers are possibly the most un-intelligent things ever invented, yet we let them control the world. Possibly a reflection of our own stupidity.

Robert L. Johnson III
MCSA, CNA, Net+, A+
w: rljohnso@stewart.com
h: wildmage@tampabay.rr.com
 
Assuming there is a way to discern your users based on their lan login, use this code - thank you JoeMiller (a fellow Tek-Tips User)

See thread 181-126848 (Access Other Topics - How Do I Read from the Registry?)

Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpbuffer As String, nSize As Long) As Long


Function fOSUserName() As String
'Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName As String
strUserName = String$(254, 0)
lngLen = 255
lngX = apiGetUserName(strUserName, lngLen)
If lngX <> 0 Then
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = &quot;&quot;
End If 'If lngX <> 0 Then
'Debug.Print fOSUserName
End Function

Very useful! Good luck.

SATHandle

Don't beat your head against the wall unless you know how to plaster.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top