Solved

Error when selecting an item from the list of a DBCombo Box.

Posted on 1998-09-07
2
164 Views
Last Modified: 2012-06-22
Hi,

I'm running VB5 with Service Pack 3 applied. I Have a form with a data control on it and a DBComboBox and several text boxes bound to the data control. When I step through the recordset using the data control's buttons everything is fine, all the controls keep in sync. However when I click on the ComboBox and select an item from the list, I get the following error :

Error 3426, This action was cancelled by an associated object.

When I hit the debug button it hightlights the following line :

Data1.Recordset.Bookmark = DBCombo1.SelectedItem

As far as I'm aware the SelectedItem property returns a variant value. Am I using the right property or is there another one which I should use. This also occurs if I use the Sheridan data bound ComboBox.

Any Suggestions?

Thanks,
John Gill.
0
Comment
Question by:jgill
2 Comments
 
LVL 9

Accepted Solution

by:
Dalin earned 100 total points
ID: 1433426
jgill,
You need to find the record that matches the dbcombo.
in the dbCombo change event (or Click), add:

data1.recordset.findfirst "fieldName = '" & dbcombo1.Text & "'"

By the way, are you using the same data control for both recordsource and rowsource?

Regards
Dalin
0
 

Author Comment

by:jgill
ID: 1433427
Dalin,

Thankls for your response, I've not tried your suggestion yet but in response to your question: I am using the same data control for the recordsource & rowsource. I've tried using different data controls but I still get the problem.

John Gill
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
Opening Remote & Local Data Connection 2 51
Write data from SQL to CSV file - position 1 53
using Access 8 59
How to make an ADE file by code? 11 80
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

867 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

20 Experts available now in Live!

Get 1:1 Help Now