Combo box non-primary key lookup (1 Viewer)

ljoekelsoey4

Registered User.
Local time
Today, 21:17
Joined
Mar 16, 2017
Messages
49
I've a form that uses a combo box to find a record by the primary key (ID number), and then to load all associated records (clinic appointments). I'd like however to use a combo box to search for a record in the table not by the primary key, but by the patient surname, and then by using the associated patient ID from the selected record to load all the associated clinic appointment records as stated before. Is this possible?
 

June7

AWF VIP
Local time
Today, 12:17
Joined
Mar 9, 2014
Messages
5,496
This primary key is the PatientID? User selects name but search uses the PatientID? Why would you do different? If you use surname, will get wrong results if there is more than one person with same surname.
 

ljoekelsoey4

Registered User.
Local time
Today, 21:17
Joined
Mar 16, 2017
Messages
49
essentially the users want a search function where they can search patient by surname, and I really can't figure how to get it to work.

thanks
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:17
Joined
May 7, 2009
Messages
19,246
its better to start on a New form than modify the existing one. therefore you will not be distracted by any code on the old form.

you can post a sample of the db you want to work.
 

June7

AWF VIP
Local time
Today, 12:17
Joined
Mar 9, 2014
Messages
5,496
The users select patient name from combobox but code uses the patientID. Users think the search is based on surname but in actuality the code uses ID. Again, why would that not meet the requirement? If this isn't what you are currently doing, what is the combobox you currently have?
 

bob fitz

AWF VIP
Local time
Today, 21:17
Joined
May 23, 2011
Messages
4,726
essentially the users want a search function where they can search patient by surname, and I really can't figure how to get it to work.

thanks
Why don't you your current combo box but hide the ID column and make the Surname the first visible column. You will need to show other columns so that users can select the correct record
 

Users who are viewing this thread

Top Bottom