ComboBox (1 Viewer)

nancy54

Registered User.
Local time
Today, 01:52
Joined
Jun 19, 2018
Messages
49
Hello,
I have created a combo box with 3 columns; ID, LastName, FirstName.
I want the user to be able to search by the LastName, but have the ID entered.
What settings in the Property Sheet would accomplish this?

Thanks, Nancy
 

isladogs

MVP / VIP
Local time
Today, 05:52
Joined
Jan 14, 2017
Messages
18,186
Make id the first bound column and hide it by setting the width to zero.
Display the other two columns.
 

Solo712

Registered User.
Local time
Today, 01:52
Joined
Oct 19, 2012
Messages
828
Hello,
I have created a combo box with 3 columns; ID, LastName, FirstName.
I want the user to be able to search by the LastName, but have the ID entered.
What settings in the Property Sheet would accomplish this?

Thanks, Nancy

If you want to order the combo by LastName instead of ID, display the design of the table, select the combo and then the Lookup tab. On the Lookup tab change the ORDER BY in Source Row to "ORDER BY [LastName]".

Best,
Jiri
 

June7

AWF VIP
Local time
Yesterday, 21:52
Joined
Mar 9, 2014
Messages
5,424
Advise NOT to build lookups in table http://access.mvps.org/Access/lookupfields.htm

Build combobox on form. Consider:

RowSource: SELECT ID, LastName & ", " & FirstName AS FullName FROM tablename ORDER BY LastName, FirstName;
ColumnCount: 2
BoundColumn: 1
ColumnWidths: 0";1"
ControlSource: field to save ID into
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 00:52
Joined
Feb 28, 2001
Messages
27,001
Concur with June7. Having a lookup field in a table leads to more trouble than it is worth once you start trying to do advanced programming designs. Simple stuff, lookup is OK - but the MOMENT you try to do JOINs, lookup fields participating in the query gives you crazy results.
 

Users who are viewing this thread

Top Bottom