?
Solved

DBCombo box selection

Posted on 1998-08-25
4
Medium Priority
?
287 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 1

Author Comment

by:chaos_59
ID: 1431022
Edited text of question
0
 
LVL 1

Expert Comment

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

Author Comment

by:chaos_59
ID: 1431024
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 200 total points
ID: 1431025
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
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…
Suggested Courses
Course of the Month14 days, 5 hours left to enroll

800 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