Go Back   Access World Forums > Microsoft Access Discussion > Tables

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 06-08-2019, 08:59 AM   #1
nancy54
Newly Registered User
 
Join Date: Jun 2018
Posts: 49
Thanks: 11
Thanked 0 Times in 0 Posts
nancy54 is on a distinguished road
ComboBox

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

nancy54 is offline   Reply With Quote
Old 06-08-2019, 09:06 AM   #2
isladogs
Part time moderator
 
isladogs's Avatar
 
Join Date: Jan 2017
Location: Somerset, UK
Posts: 10,348
Thanks: 112
Thanked 2,841 Times in 2,591 Posts
isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold isladogs is a splendid one to behold
Re: ComboBox

Make id the first bound column and hide it by setting the width to zero.
Display the other two columns.
__________________
If this answer has helped, please click the Thanks button and/or click the 'reputation scales' symbol on the left.

Website links:
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Colin
Access 2010 32-bit, Access 2016 32-bit & 64-bit, SQL Server Express 2014, Windows 10,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
,
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
isladogs is offline   Reply With Quote
Old 06-11-2019, 12:54 PM   #3
Solo712
Newly Registered User
 
Solo712's Avatar
 
Join Date: Oct 2012
Posts: 738
Thanks: 14
Thanked 125 Times in 122 Posts
Solo712 will become famous soon enough
Re: ComboBox

Quote:
Originally Posted by nancy54 View Post
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

__________________
Dyslexics of the world untie !
Solo712 is offline   Reply With Quote
Old 06-11-2019, 01:04 PM   #4
June7
AWF VIP
 
June7's Avatar
 
Join Date: Mar 2014
Location: The Great Land
Posts: 2,266
Thanks: 0
Thanked 532 Times in 528 Posts
June7 will become famous soon enough June7 will become famous soon enough
Re: ComboBox

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
__________________
Attach File Manager is below Advanced editor window, click Go Advanced below Quick Reply window. To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
DEBUG! DEBUG! DEBUG!
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
June7 is offline   Reply With Quote
Old 06-11-2019, 01:33 PM   #5
The_Doc_Man
Happy Retired Curmudgeon
 
Join Date: Feb 2001
Location: Suburban New Orleans, LA, USA
Posts: 14,345
Thanks: 87
Thanked 1,642 Times in 1,524 Posts
The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold The_Doc_Man is a splendid one to behold
Re: ComboBox

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.

__________________
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.
The_Doc_Man is online now   Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Filter a combobox in a subform with another combobox from main form jjake Forms 3 12-18-2015 05:44 AM
Help with a bound Combobox - One change in Combobox changes another combobox DaveBre Forms 10 08-20-2013 08:39 AM
requery mainform unbound combobox using subform combobox value afterupdate Mikkel Forms 3 02-27-2012 07:56 AM
Auto-Assign a value to a combobox based on a previous combobox entry sguan Forms 1 07-15-2011 09:36 AM
Filter Subform ComboBox based on Master Form ComboBox selection azammalick Forms 1 12-16-2009 12:27 PM




All times are GMT -8. The time now is 06:42 PM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World