Solved

Filling a DBCombo Box

Posted on 1998-12-19
7
290 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
7 Comments
 
LVL 12

Expert Comment

by:jgv
Comment Utility
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
Comment Utility
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
Comment Utility
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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 2

Expert Comment

by:JiaH
Comment Utility
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
Comment Utility
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
Comment Utility
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 50 total points
Comment Utility
critter017:
Glad I could help. Everyone gets stumped by a simple oversight once in a while so don't sweat it.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…

763 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

9 Experts available now in Live!

Get 1:1 Help Now