Solved

Assign table´s to a ComboBox linked to TDBChart

Posted on 1998-10-25
6
228 Views
Last Modified: 2010-04-06
I need help with assigning my table's (paradox7) to a ComboBox or a TDBLookUpComboBox and then it should be updated in my TDBChart. I want the name of my table's in the ComboBox.

Anyone can help me?
Thanks!
0
Comment
Question by:bert1
[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
  • 4
  • 2
6 Comments
 

Expert Comment

by:elkiors
ID: 1344218
Have you got the table connected to a TDataSource, you will need to do this I think.

eg. Link table1 to datasource1 then with the TDBLookupCombo point the datasource to datasource1 and then set the datafield for the table1 lookup field.

Also have a look at creating persistant lookup fields for your table, it takes a lot of pain out of creating lookups as delphi does all the linking and value assigning for you.

Let me know how you get on.
0
 

Author Comment

by:bert1
ID: 1344219
I have the table connected to a TDataSource. In the datafield in LookUpComboBox I can choose the fields in my table, but im getting a circular error when I choose one field. But I want to have the all the tables in the LookUpComboBox... not a field in my table.

You see what I mean?
0
 

Expert Comment

by:elkiors
ID: 1344220
Do you mean you want to create a list of table names to be shown in the combo ? If so let me know, and I'll post a code snippet.

Darren

0
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!

 

Author Comment

by:bert1
ID: 1344221
Yes that´s what I mean and I will link them to a TDBChart that updates when I change the name in the combo. I have different graph´s in the tables.
0
 

Accepted Solution

by:
elkiors earned 50 total points
ID: 1344222
I've just realised, the code was less intensive than I thought.
Will this do

put a normal combo box on a form and add this code to the onshow event to populate the combo box with the tables in the alias you define. I got this straight from the online help, you could probably find a bit more to help with the chart and stuff.

procedure TForm1.FormShow(Sender: TObject);
var
  MyTables:TStringList;

begin
  MyTables := TStringList.Create;
  try
    Session.GetTableNames('DBDEMOS', '*.db',False, False, MyTables);
    { Add the table names to a combo box }
    ComboBox1.Items := MyTables;
  finally
    MyTables.Free;
  end;
end;

Hope this is what you wanted

Darren
0
 

Expert Comment

by:elkiors
ID: 1344223
Is there anything else I can do ?

Darren

0

Featured Post

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!

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 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