?
Solved

Data-bound combo box

Posted on 1998-08-30
7
Medium Priority
?
498 Views
Last Modified: 2010-04-30
I am trying to write a simple recipe management program, using a data control and a data-bound combo box.  I want the combo box to be populated using all the recipe names on file for a certain category (e.g., list all the recipes from the "Appetizers" category).  My data control's RecordSource property is a query (list all recipe names where the category = "Appetizers").  The combo box populates correctly, but when I select one of the entries, my other text boxes are not updated with the data for that recipe (even though their DataSource and DataField properties point to my database). If I put in a Data1.Refresh in the dcCombo_Change event, the combo box text is always changed back to the original selection.  How do I update the current record to indicate a new selection from the combo box?
0
Comment
Question by:tttaff
[X]
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
  • 3
  • 2
  • 2
7 Comments
 
LVL 1

Accepted Solution

by:
disha earned 100 total points
ID: 1431927
Hi,
The data control or other controls wont move to that record automatically. In the combo click event, get the index of that combo list in a var A and then move the data control after refreshing to that record no using a for loop. i.e do MOVENEXT from 0 to A times.
Regards

0
 
LVL 1

Expert Comment

by:disha
ID: 1431928
Hi,
I am sorry...Forget the upper part....I was confused ...
just use this...it will work
data1.recordset.bookmark = dbcombo1.selecteditem

where dbcombo1 is bounded to u'r data1 control
0
 

Author Comment

by:tttaff
ID: 1431929
Following your suggestion, I entered the following command in my
dbcRecipeName_Change event:

    dtaAppetizers.Recordset.Bookmark = dbcRecipeName.SelectedItem

dbcRecipeName is the combo box; dtaAppetizers is my data control.

When I run the program, I get the following error after selecting an entry fromthe combo box:

     Run-time error '3426':

     The action was cancelled by an associated object.


0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 1

Expert Comment

by:disha
ID: 1431930
put it into u'r click event of the combo...not in the change
event.what is the error message it gives with error no 3046.

Regards
0
 

Author Comment

by:tttaff
ID: 1431931
I tried putting this into the combo box click event as you suggested - same error as before: '3426"
0
 

Expert Comment

by:uyeshiro6
ID: 3928992
Hi tttaff,

Did you get your problem fixed?  The reason is I have the same problem/need as you have and am looking for a solution.  I have  categories  and subcategories and want only to bring up the subcategories of the selected category, using data cbo.   I'm new to VB6.  Have done this in Access many times...

Ron
0
 

Expert Comment

by:uyeshiro6
ID: 3929250
Hi tttaff,

Did you get your problem fixed?  The reason is I have the same problem/need as you have and am looking for a solution.  I have  categories  and subcategories and want only to bring up the subcategories of the selected category, using data cbo.   I'm new to VB6.  Have done this in Access many times...

Ron
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…
Suggested Courses
Course of the Month8 days, 15 hours left to enroll

764 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