Solved

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

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB6 - Compare and highlight cell not the same 3 49
I need help embedding an image as HTML in my vb.net application 3 64
vbModal 12 51
Excel Automation VBA 19 68
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…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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 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…

785 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