Solved

Problems with TComboBox !!!!

Posted on 2001-07-12
8
226 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 50 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

Independent Software Vendors: 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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

628 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