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!

Two users updating info

Status
Not open for further replies.

duns

Programmer
May 22, 2000
13
0
0
AU
Hi,

I was wondering if anyone knew how I could set up security so that it would record in a table the name of the user making changes.

I have an access front end and a sql server backend.
 
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];

Thanks a million
 
Forget the post, I'm very sorry I posted to a wrong thread.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top