Solved

DBCombo box selection

Posted on 1998-08-25
4
284 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
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 100 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

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…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

832 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