Solved

DBCombo box selection

Posted on 1998-08-25
4
282 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Write data from SQL to CSV file - position 1 53
Cannot enter table caption text in Word protected document 6 114
Excel object stays open 19 71
Excel Automation VBA 19 38
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
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…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

863 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

27 Experts available now in Live!

Get 1:1 Help Now