store user name in table and show up in field

megatronixs

Registered User.
Local time
Today, 23:55
Joined
Aug 17, 2012
Messages
719
Hi all,

I managed to count the performance of users. The only thing I need to do is to put the names of the users on the form (under different tab) so I can select them and they show their performance. The best would that they are showing up there in the form till I change the names. I use now a text field to write the name, but when I close the database and open, I need to add the name again.
If I could use somehow the names from the users stored in a table, that would be great.

Greetings.
 
Hi MegaTronixs
I found this code on the forum

Function GetLogonName() As String
' Dimension variables
Dim lpBuff As String * 255
Dim ret As Long

' Get the user name minus any trailing spaces found in the name.
ret = GetUserName(lpBuff, 255)

If ret > 0 Then
GetLogonName = Left(lpBuff, InStr(lpBuff, Chr(0)) - 1)
Else
GetLogonName = vbNullString
End If
End Function

In the Public section of a module, I declared . . .
Dim MyUser as String

On each form I have a field to store the userName

Before Update event
userName = MyUser
 
More information required...or, at least, this is my understanding.

You have a form you are using for data entry. The data entered obviously goes to an underlying table. On that data entry form you have a textbox where you enter a person's name and, on entering the next record you want to retain that user name. Going further, you want to retain the user name between sessions on the database.

Is this right?
 
Hi all,

I'm using this formula to count the work done by the users. I need to show all users on the same tab (performance tab). So I needed to check for the names (no pc user name). The thing is that if some one will leave, I can change the name and than it will count based on that name. This is the formula that I'm using now:

Code:
=DCount("*","ClientTable","[PersonPassQA] = 'Peter' AND [DateStarted] =  " & CDbl(Date()))

I created a table with the name of the users and wanted to select one of the user for each field from a combobox, but somehow I need to store the name on the name on the form so the formula will get it. I just don't have a clue how to start with it.

Greetings.
 
Hi all,

Please see the attached database. There are 2 tables. One I called Analyst and the second the ClientTable. On the Analyst table I have the persons I need to check the performance. On the ClientTable I have the dates, customer names and analyst names fields. There are 2 forms: LetterProduction and Performance. On the LetterProduction form the data is entered and on the Performance form I should be able to see the letters registered, produced, passed to QA, QA done and Printed. When I choose one of the names of the analyst table, the fields should calculate or sum the times a date and analyst name occur. As example, on today's date, Peter did pass 2 for QA.

Maybe with the database file it will be easier to see what I need.

Greetings.
 

Attachments

Users who are viewing this thread

Back
Top Bottom