easy stuff with a combobox ... 
Author Message
 easy stuff with a combobox ...

Hi All ....
I know this one will probably seem easy for you but i am an absolute
beginner delphi/builder...
Here is what my application needs to do :
I need to display a set of values from a db table into a combobox (read only
access is enough)...
what are the properties and additionnal code needed to be set in the TTable
object and the combobox ??
2 more questions :
how do i display several field values in the dropdown part of the combobox ?
how do i get the info on the selected record ?
this is so easy and straight forward to do with visual fox pro and i can't
figure it out with delphi/builder...
thanx for helping me


Sat, 24 Mar 2001 03:00:00 GMT  
 easy stuff with a combobox ...
Quote:
> Hi All ....
> Here is what my application needs to do :
> I need to display a set of values from a db table into a combobox (read
only
> access is enough)...

Well, the most straight forward way to do it looks like this:

While not Table1.EOF do
begin
   MyCombo.Items.Add( Table1.FieldByName('MyField').AsString );
   Table1.Next  
end;

Quote:
> 2 more questions :
> how do i display several field values in the dropdown part of the

combobox ?
Not sure it's possible, as far as Delphi3 is concerned... :-(

Quote:
> how do i get the info on the selected record ?

Depends on the kind of info. You can use DBGrid and load the data in to it
depending on the selected value in Combobox. There is also a thing, called
LookUpCombo. I tried to use but failed. Hope there is somebody more
succesful ;-)

Quote:
> thanx for helping me

You're welcome

Dmitri



Sat, 24 Mar 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Display Column items in a combobox (newbie)

2. little problem with combobox

3. Delphi1 colors in combobox, focus problem

4. dynamically filter combobox

5. Dynamically adapting filter in a combobox

6. DataSource and Standard ComboBox: Strange Combination.

7. Combobox dropdown in DBGrid

8. Combobox Click

9. ComboBox into a DbGrid ?

10. Q: (Newbie) Using ComboBox and Navagator to search database

11. combobox and dbgrid

12. d1 combobox gpf

 

 
Powered by phpBB® Forum Software