?
Solved

Master-Detail Problem

Posted on 1999-01-01
3
Medium Priority
?
250 Views
Last Modified: 2010-04-04
When the user moves to a new record in a DBGRid via the DBNavigator, mouse click, or using the up and down arrow keys of the Master table, the Detail table DBGrid displays the correct records.  What I want to do is display some information in a TPanel based on what the current record in the Detail table is whenever the user moves to a new record in the Master.  I have gotten this to work if the user uses the DBNavigator, but nothing else.

What I need is the code to make this work.

Thanks for your help.
0
Comment
Question by:tecmaster
[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
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
adeng earned 600 total points
ID: 1354174
Hi, i hope i don't miss understand what do you mean. Try to use OnDataChange on DataSource Component of Detail Table.

procedure TForm2.DataSourceDetailTableDataChange(Sender: TObject; Field: TField);
begin
     Panel1.Caption := DetailTableNAME.AsString;
end;

Regards, Adeng
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1354175
hi tecmaster,

when mastertable- and masterfields-propertys in your detailtable are probably set, and a datasource is connected to your detailtable, so you can use dbeditfields connected to the datasource of your detailtable in your panel .

The fields display the first detailrecord by moving in the mastertable automatically.

if you want to show how many detailrecords are available depending on your mastertablerecord, you can do it with this.

procedure TForm1.YourMasterDataSourceDataChange(Sender: TObject; Field: TField);
begin
  edit1.Text := inttostr(YourDetailTable.RecordCount);
end;



meikl
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1354176
hi tecmaster,

my braindictionary failed
i mean properly instead of probably

meikl
0

Featured Post

Technology Partners: 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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

771 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