Solved

DBCombo box selection

Posted on 1998-08-25
4
281 Views
Last Modified: 2010-04-30
I have a DBCombo box listing records from an access database. The field that is displayed in the combo box is not unique so many times an item will appear multiple times in the control. Each occurrence is for a unique record with different field values, they just have the same name. My problem is that when multiple items are listed and I select any of them the control always selects (.bookmark) the first occurrence. For example if records 19, 25 and 45 all have the description ABC, the control will display all 3 records, but no matter which one I select it always sets the .bookmark to record 19. Is there a way around this? Am I doing something wrong?
0
Comment
Question by:chaos_59
  • 2
  • 2
4 Comments
 
LVL 1

Author Comment

by:chaos_59
Comment Utility
Edited text of question
0
 
LVL 1

Expert Comment

by:raygibbins
Comment Utility
You should give each record a unique ID, and use this ID to select the record.
0
 
LVL 1

Author Comment

by:chaos_59
Comment Utility
This isn't an option. The database is already in use. The only unique part of the record is the record key, a numeric field that is meaningless to the user.
0
 
LVL 1

Accepted Solution

by:
raygibbins earned 100 total points
Comment Utility
Ensure that the datasource for the DBCombo has the KeyField

Set the listfield property to be the field you want the user to see

Set the DataBound  and DataField properties of DBCombo to be this Field

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now