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

tracking user name 1

Status
Not open for further replies.

ssdex

Technical User
Jan 11, 2007
6
US
I am trying to create some sort of log that adds date and time as multiple users are using the front end of a split database. I tried using the fosusername() function that has been talked about in many posts. It works ok, but the problem is when a new user logs in it adds that user to every record.... hence the get current username. Is there anyway to keep it from modifying existing records and only adding the current user to current records? I am very new to access. Thanks!
 
Perhaps instead of putting the function as a default value in the table or form, you could leave it blank.

on the form, include the username control but make it invisible.

Then, on the Before Update event of the form, set the control equal to your function.

 
Can you explain how "when a new user logs in it adds that user to every record"? Have you actually looked at the table data to see if the username is being stored in the records? How are you updating the user name in the records?

Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
well i started out by trying to get the windows user in a hidden field in a form that related to a table.... then i decided it would be easier since i already had security level in access to get that user instead with the function =currentuser() as the default for [username] and then using a before update event [username]=currentuser(), however when i plug this in, it gives me an error saying its looking for a macro or something.... any help??? what should the exact before update say? Im moving this to the forms forum, but if anyone reads this please feel free to help in this forum!
 
You can't place
[username]=currentuser()
into the property. You can open the code window for the event and enter the code. The event property should read:
Before Update.......[Event Procedure]____[v][...]


Duane MS Access MVP
[green]Ask a great question, get a great answer.[/green] [red]Ask a vague question, get a vague answer.[/red]
[green]Find out how to get great answers faq219-2884.[/green]
 
haha, yea that was definately the problem... thank you for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top