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

Setting unique combo box views for individual users

Status
Not open for further replies.

mkuethe

Technical User
Jul 19, 2001
25
0
0
US
I have a database that is used by approximately 50 people. Each person enters their daily activity onto a form. I have a combo box on the form that displays all worker names. Is there anyway to have each worker's name selected in the combo box automatically when they use the form?

Example: When John Doe goes to enter a new record, his name is already shown in the "Workers" combo box field, but when Jane Doe enters a record on her system, her name shows in the "Workers" combo box field.

Any assistance you can provide would be greatly appreciated!

Thanks! :cool:
 
Well, you can only do this if the Access knows who each user is, i.e. you have some kind of log-on to Access, in which case you can capture their log-on through the CurrentUser function. You would then set the combo's value to be =CurrentUser().

If you don't have a log-on and you want to capture the person logged onto Windows, that is more complicated and someone more experienced than my humble self to explain it. Have fun! :eek:)

Alex Middleton
 
Try this for getting the user name from a network....


Dim lngLen As Long
Dim lngX As Long
Dim strUserName As String
'API declaration
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long

Function OSUserName() As String 'Returns network login name

strUserName = String$(8, 0)
lngLen = 9
lngX = apiGetUserName(strUserName, lngLen)

If lngX <> 0 Then
OSUserName = Left$(strUserName, lngLen - 1)
End If

OSUserName = strUserName

End Function

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top