Combo Box display and value

G

Guest

this is simply what I want. If you cuold help
me construct the code to make this happen, i would appreciate it; for i am
very unfamilar with Access. I have a combo box called cboEmp. That combo box
should display, when both closed and open, a combination of LastName + ',' +
FirstName + ' ' + TitleID. However, when a certain record is selected in this
drop down, I want the chairs ID to be stored into the WatchResults table. How
do i do this? Right now when i select an item in the combo box, only the
first list appears after an item is selected. I want something like "Mr. Ty
Masterfield" to appear. Thanks for your help.
 
D

Dan Artuso

Hi,
You use a query that pulls the 'chairs id' and concatenates the name:

Select chairsId, LastName & "," & FirstName & " " & TitleId FROM somewhere

Make sure your combo has two columns with widths of 0" and 1" respectively.
Make the bound column 1 and have the control source for it be whatever field you want
to store the id in.
 
G

Guest

Right now i have done everythign you have said, and when i click on the drop
down, a box pops up and asks me to enter a ChairID. What could be happening
here?
 
G

Guest

it says enter parameter values

Ty said:
Right now i have done everythign you have said, and when i click on the drop
down, a box pops up and asks me to enter a ChairID. What could be happening
here?
 
G

Guest

Row Source: SELECT ChairsID, LastName & "," & FirstName & " " & TitleId FROM
Employee;

Bound Column 1
 
D

Dan Artuso

Hi,
Okay, I forgot the AS thing:
Row Source: SELECT ChairsID, LastName & "," & FirstName & " " & TitleId AS FullName FROM
Employee;
Other than that, are they all valid field names?
 
K

Ken Snell [MVP]

Dan, it looks as if you and I are answering the exact same question for Ty.
I've been answering the same question in .formscoding, I believe.

Ty, I am abandoning that other thread. Please do not multipost (post same
question in different groups as individual posts). You end up causing more
than one person to be answering your question at the same time, each
answerer not knowing that he/she is duplicating others' work.
 

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