ComboBox

nancy54

Registered User.
Local time
Today, 10:09
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
 
Make id the first bound column and hide it by setting the width to zero.
Display the other two columns.
 
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
 
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
 
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

Back
Top Bottom