If your database requires logon, you can use the CurrentUser() function to retrieve the name the user logged on to Access with. You can just assign this value to an invisible control bound to the table field in which you want to store it. (Do this in the Form_BeforeUpdate event procedure.)
If your database doesn't require logon, CurrentUser() will return "Admin", which isn't very helpful. In this case you might be able to retrieve the name by which the user logged on to the network, using a Windows API call, but whether you can and how you do it depends on what kind of network software you're running. And I don't have any knowledge in that area. Rick Sprague
Help!
I have 2 tables, I can manage to use 4 querys to put the data from table1 and caculate the sum of hrs and insert into the second table2(shown as below). Now the question is how I can rewrite the 4 query so it can updated the second table so that all the data is shown in one row that belong to that user instead adding to another row w/ same user again.
User Ttl_Client Ttl_Util Ttl_NonUtil Ttl_NonAsera
Litsinger Jennifer 29
Shubhra Sinha 6
Litsinger Jennifer 4
Shubhra Sinha 12
Shubhra Sinha 18
example of one query of 4:
INSERT INTO total_hrs ( [User], Ttl_Client )
SELECT [UserTime].[User], Sum([UserTime].[Hours]) AS Ttl_Client
FROM UserTime
WHERE ((([UserTime].[Account])="Client")
GROUP BY [UserTime].[User];
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.