Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problems with TComboBox !!!!

Posted on 2001-07-12
8
Medium Priority
?
229 Views
Last Modified: 2010-04-06
How can I load on the TComboBox component one colum of a TDBGrid (I load one Table1) that I create from a DataBase (Access 97).
I only could load the first line of my Table1 with this:

cant := Form1.Table1.RecordCount;
  for  i := 0 to cant do
    Form3.List.Items.Insert(i, Form1.Table1);

I need to load each line of one colum.  Thanks.
0
Comment
Question by:matuf
[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
8 Comments
 
LVL 22

Expert Comment

by:Mohammed Nasman
ID: 6277226
Hello

  change ur code as following ,you are adding only the first record, so you need to move to the next one


cant := Form1.Table1.RecordCount -1;
 for  i := 0 to cant do
  begin
   Form3.List.Items.Insert(i, Form1.Table1);
   Form1.Table1.Next;
  end



0
 
LVL 9

Expert Comment

by:ITugay
ID: 6277232
Hi matuf,

something like this:

Table1.DisableControls;
Table1.First;
while not Table1.EOF do
begin
  ListBox1.Items.Add(Table1.Fields[3].AsString);
  Table1.Next;
end;
Table1.EnableControls;

0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 100 total points
ID: 6277252
recordcount is not allways properly set,
depending on the database

better would be
table1.first;
while not table1.eof do
begin
  Form3.List.Items.add(table1.fieldbyname('fieldwhateverneeded').asstring;
  table1.next;
end;

meikl ;-)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 9

Expert Comment

by:ITugay
ID: 6277277
:-)
0
 

Author Comment

by:matuf
ID: 6277301
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6277422
hu,
igor didn't see your comment before now,
sorry to get a grade, which should you have get

but anyway

matuf, thanks for the points :-)
glad to be of service
good luck again

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6277425
igor, its only a c-grade :-(
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6277457
really? I miss nothing :-)
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

715 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