Solved

Master-Detail Problem

Posted on 1999-01-01
3
246 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 150 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

705 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