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!

Using the Loginid from the computer for access security 1

Status
Not open for further replies.

tlstevens

Technical User
Aug 15, 2005
9
0
0
US
I would like to add security to an existing access database/program. Initially, I do not want to stop anyone from accessing the data but I want to use the id for queries, and customizing views. However, I do not want to add another log-in for the user. So what I would like to do is call the id of the user logged into the system and set that to the user-id for access. I hope that is clear. and that someone can offer help. Thanks for any information or direction you can offer
 
You can identify the network username within an Access application but you cannot use it for Access workgroup security.
Workgroup security requires you to log in to Access before any application is open, so you cannot intervene at that point.

To use the network username as the Access workgroup username you need to build a separate front-end to your Access applications (in VB, say) which CAN get the username and create a startup command for the Access application incorporating the username.

 
Then if security is not -- at least initially -- my concern, then i could write a table to link network username to the current list of "techs". And work on writing that VB front end as I can. (I can't find the function for getting the network id.) Does that sound workable?
 
I created a button to work with the function. I'm getting the error: Compile error: Expected variable or procedure, not module.

Private Sub Command111_Click()
On Error GoTo Err_Command111_Click

Dim stDocName As String
Dim stLinkCriteria As String
Dim curuser As String

curuser = fOSUserName()
stDocName = "Current open"
MsgBox ("The current user is: " & curuser)
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command111_Click:
Exit Sub

Err_Command111_Click:
MsgBox Err.Description
Resume Exit_Command111_Click

End Sub


 
Seems you have named the module fOSUserName.
Simply rename it.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi you want to do what i recently added to mine. its a simple security step...

its takes the user name of the logged in windows user, looks it up in a users table to check what rights they have.. if they are an admin the DB is opened up, if they are a supervisor, i disable alot of commands so that they cant use it.

i can talk you through this in more detail if you think this is what you are after?
 
Yep. That's exactly what I need to do. That and return queries based on whose logged in.

Thank You!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top