Solved

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

Posted on 1998-09-07
2
158 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

758 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