D
David M C
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
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