Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

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

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

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

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

860 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