Logged in user & DLookup

G

Guest

Here's my table structure:

Employees:

EmployeeID (primary key)
FirstName
LastName
UserName

Orders:

OrderID
RequestedBy (foreign key to EmployeeID in Employees table)
....

On my form I use a combobox to select the employee (the user selects by
LastName, FirstName but the EmployeeID is bound).

I have the Logged In User module/api and tested this works by putting a
control on my form with default value = fosUserName(). This works.

Now I would like the default value of my combo box to be looked up using a
DLookup. I would like the EmployeeID that corresponds the logged in user
[UserName] = fosUsername() returned. This is what I have tried, but it does
not work:

=DLookup( "[EmployeeID]", "Employees", "[Username] = " "" &fosUsername()
&"""")

This doesn't work. Is it ok to use DLookups in the Default Value field? Any
ideas how I can get it to work or another way of achieving the same result?

Thanks,

Dave
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 
E

eos

AUTO-REPLY From George Levitt

Please allow this to confirm a system receipt of your e-mail.

I am out of the office until Wednesday morning (1/12/05) and will not be
reviewing or responding to email or voicemail until that time.

I look forward to replying to your message on Wednesday.

Thanks and warmest regards, George
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top