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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox- only selecting 1st record if bound column data is indentical

Status
Not open for further replies.

egrant

Programmer
Mar 6, 2003
42
AU
Hi,

I have a combo box that is finding a record on my form based on the data I select in the combo box.

It has an ID field but I am not using that field in the combo box.

I am using a name field so I can search for a persons "Name" that I want to select and then hitting enter displays the record data on the form.

BUT... If there is more then one name...ie there are two Jane Does with two seperate records, the combo box will only let me select the FIRST record. It does NOT let me select the second.

Any idea of a way around this? Or a Microsoft Article that covers this?

Thanks,

EMG

 
Your combobox has a bound field identified and you have probably got that set to the name column of your Row Source. So, when you pick the second Jane Doe the code searches the name field and the first one it finds it displays that record.

What you need to do is have your RecordID or AutoNumber identified as the Bound column in your combobox and change the code in the AfterUpdate event procedure. You see the field that is being searched has to be searched with a unique identifier otherwise you get the first one matched.

Look in the properties of your combobox and copy and paste the Row Source SQL and the Bound Column value. We probably need to add the ID field to the SQL but make it hidden in the columns. Then identify that column as the Bound Field and perform the search on the field with this ID value.

I hope I haven't talked in circles here but I do believe this is the solution to your problem. Bob Scriver
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top