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!

Dafault Value Based on Current User

Status
Not open for further replies.

cranebill

IS-IT--Management
Jan 4, 2002
1,113
US
I have a form that has an entry field for the name of the person that is entering the Data. I have security and permissions set up on this database and i was wondering how to maybe get the default value to be the current user. This is a shared application so there may be more than one person logged in at a time. I am not sure if this will make it difficult or not. Any Help would be greatly appreciated.
 
Hi

If the User Log in id is the persons name, then a simple txtUserName = CurrentUser() will do it.

If the relationship between User Log in Id and Actaul name is not so straight forward, you need to (say) have atable of user Ids and actaul names so that you can convert between UserId and User Name.

Hope this helps Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
And dang it i seen my typo in my heading... lol default* not dafault lol i must live in da hood lol
 
I put txtUserName = CurrentUser() in the default section of this field and its states that CurrentUser()is not a recognized function... any other ideas?
 
Hi

I described setting the text box control on the form to CurrentUSer(), you cannot use CurrentUser() in the default property of the field in the table design Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
UK
 
Can't use CurrentUser as a default value in the table, but you can use it as a default value in a form. Try that.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.
 
Thank you guys, the information was very helpful.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top