473,466 Members | 1,381 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

currentuser question

12 New Member
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
3 1442
ADezii
8,834 Recognized Expert Expert
@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
JohnHo
12 New Member
Thanks that worked fine!
Mar 4 '09 #3
ADezii
8,834 Recognized Expert Expert
@JohnHo
Glad it worked out for you.
Mar 4 '09 #4

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

Similar topics

3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
2
by: Mark Flippin | last post by:
I'm converting an Access 2000 database (fe/be) to a SQL Server 2000 backend. This is a quick and dirty conversion, using linked files via a file dsn, and is to be completed ASAP with minimal...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
5
by: Dax | last post by:
Hi, how can Identify a domain user that send a form made with ASP. I have see that exist a variable called currentuser, but what does it mean? Thanks in advance, Dax
6
by: reidarT | last post by:
How do I get current user logged in with vb.net code? reidarT
2
by: PowerLifter1450 | last post by:
Hi all, I have fields in my tables which get updated to the UserName when someone inserts/updates records through a form. However, I have created append queries that are importing records to the...
10
by: Mourad | last post by:
Hi All, CurrentUser() returns null when called from a form event handler, at least from Form_Open()! However, it works fine in other forms! Use Application.CurrentUser seem to work, but I'd...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.