?
Solved

Filling a DBCombo Box

Posted on 1998-12-19
7
Medium Priority
?
302 Views
Last Modified: 2013-12-25
Using VB4.0 Enterprise Edition
Have a database named carbo.mdb with a field named FoodType.  Set the properties in a Data Control named Data1.  When I click on properties of the DBCombo, I do not get a list of properties to set.  Using code like this:

   Set DBCombo1.RowSource = Data1

   Set DBCombo1.ListField = FoodType

produces an error.  How do I populate the DBCombo Box with the entries in the FoodType field?
0
Comment
Question by:critter017
[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
7 Comments
 
LVL 12

Expert Comment

by:jgv
ID: 1498414
1. Set the DatabaseName (carbo.mdb) for Data1
2. Set the RecordSource (a table from carbo.mdb=FoodType?) for Data1
3. Set the RowSource (Data1) for DBCombo
4. Set the ListField (a field from FoodType table) for DBCombo

This can all be set at design time. I am using VB5 and am not sure how VB4 is setup but I hope this helps.
0
 
LVL 1

Author Comment

by:critter017
ID: 1498415
Where do I set the RowSource and ListField properties?  I do not get a property window when I click on "properties" in design view and have the DBCombo box selected.  This is my problem.  Everyone gives me the same answer, but the code does not work and I have no properties window.  What am I doing wrong?
0
 
LVL 12

Expert Comment

by:jgv
ID: 1498416
As I've said, I have not used VB4 and am unfamiliar with it's layout. In VB5 there is a properties window at bottom-right of screen. I can show it by selecting 'View' from the menu bar then 'Properties Window' or the shortcut is F4. Right clicking on the DBCombo box and selecting 'Properties' does not show Recordsource or Listfield. The Recordsource, to my understanding, must be set at design time and that is why your code is causing an error. If this does not help then you will have to wait to hear from an expert that has used VB4. Sorry.
0
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!

 
LVL 2

Expert Comment

by:JiaH
ID: 1498417
How about use the F2 to open the object browser to see, does there exist the two properties you needed?
0
 
LVL 3

Expert Comment

by:altena
ID: 1498418
With the risk of starting religeous wars....

I always populate my "lookup" Combo's and list-boxes by hand.
In VB 4 you can write a module to populate your lookup lists
and re-use these in various aplpications.
in VB5 and 6 you can write a user-control that you can re-use
in other applications.

On the other hand... This may be something between me and the data-bound-write-your-program-without-coding-and-not-having-a
-clue-about-what-happens-with-setting-1.000.000-properties-club

Good Luck :=)
0
 
LVL 1

Author Comment

by:critter017
ID: 1498419
Thank you "jgv".  I feel so dumb.  Obviously, I haven't been playing with Visual Basic very long to not know about the F4 shortcut.  Please redo your comment as an answer and I will be happy to award you the points.
0
 
LVL 12

Accepted Solution

by:
jgv earned 200 total points
ID: 1498420
critter017:
Glad I could help. Everyone gets stumped by a simple oversight once in a while so don't sweat it.
0

Featured Post

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.

Question has a verified solution.

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

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…
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…
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…
Suggested Courses
Course of the Month12 days, 22 hours left to enroll

777 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