By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,830 Members | 658 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,830 IT Pros & Developers. It's quick & easy.

currentuser question

P: 12
This is probably simple but this is the last feature for an db app and I am stumped (read fatigued).

I have created users with the Access security feature.

Additionally, I have a lookup table (lkupClinicianInfo) with user information (lngClinicianID, txtUserName, etc.) for various other purposes. The txtUserName string and CurrentUser string are exactly the same. For a new record I would like to insert the clinician ID (lngClinicianID) from the lkupClinician table based on the CurrentUser function. The main table (tblCallLog) has the lngClientID field.

I have created a query where I can select the lngClinicianID from lkupClinicianInfo table based on the CurrentUser.

The user logs onto the app and pokes a button to create a new record. How do I insert the lngClinicianID in the new record in tblCallLog?

thanks a lot!!

/jh
Mar 2 '09 #1
Share this Question
Share on Google+
3 Replies


ADezii
Expert 5K+
P: 8,623
@JohnHo
To retrieve the lngClinicianID from lkupClinicianInfo, based on the Return Value of CurrentUser():
Expand|Select|Wrap|Line Numbers
  1. DLookup("[lngClinicianID]", "lkupClinicianInfo", "[txtUserName] = '" & CurrentUser() & "'")
The Return Value would be written to the lngClientID Field of tblCallLog in some manner.
Mar 2 '09 #2

P: 12
Thanks that worked fine!
Mar 4 '09 #3

ADezii
Expert 5K+
P: 8,623
@JohnHo
Glad it worked out for you.
Mar 4 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.