Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Query

Status
Not open for further replies.
You mean when the combo box drops down it only displays last name. Can we assume you want to display first last or last, first or some other value?

I'm surprised you don't have a primary key in the query columns. What is the control source of the combo box?

Duane
Hook'D on Access
MS Access MVP
 
Thanks for the help guys, new Access user here, I would like the query to display the employee's First and Last Name, and when i select that employee from the list display both first and last names in the combo box.
 
What value do you expect to store in the field that is the control source of the combo box. Normally this would be the primary key field from the employee table. Can you provide info about your table structures?

Duane
Hook'D on Access
MS Access MVP
 
What you display in the combo and what gets saved to the underlying field can be two different things. Often we display a Name but when you select the name you actually store an ID representing the name. The bound column is what gets stored. Often the trick is to bind the ID column but not show it, and then display the name. This is done with something like

Row Source. "Select ID, LastName & ", " & firstName as FullName from some Table"
Bound Columne: 1
Column Width: 0,1.5"
Bound Column: 1

What that does is return the IDs and creates the full names. Then the first column is hidden because it has a width of 0. So you can see the names, but when you select one it stores the ID associated to that name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top