Board index » delphi » master-detail problem

master-detail problem

Hi!
I have the following problem:
I have a table (Itemstable) with a mastersource -
ClaimsDataSource and a masterfield ExpId.
All I want to know is the number of records shown at a time
depending on the value of ExpId.
The "RecordCount" gives me the total number of the records
although I can see only some of the records in a TDBGrid!
Does any one know a way of resolving it, without closing
the table?

--
Bye!

Dana

 

Re:master-detail problem


In <30BA27B1.6...@bayleaf.com> Dana Iancu <dia...@bayleaf.com> writes:
Quote

>Hi!
>I have the following problem:
>I have a table (Itemstable) with a mastersource -
>ClaimsDataSource and a masterfield ExpId.
>All I want to know is the number of records shown at a time
>depending on the value of ExpId.
>The "RecordCount" gives me the total number of the records
>although I can see only some of the records in a TDBGrid!
>Does any one know a way of resolving it, without closing
>the table?

>--
>Bye!

>Dana

The RecordCount property will give you a count of records in a Paradox
file:
a.  for the entire file if no range is selected
b.  the count for the set where a range is selected

Range selection will occur either by using SetRange or in amaster
detail relationship where the cusrsor is placed in the master record
the detail records automatically become a set.  Hence if you would set
up a label and a butoon and insert the following code for the button
OnClick event:
    Label1.Caption := intToStr(Table2.RecordCount);
where table2 is the child file and tthe cursor is positioned in
table1(Master File) and the button is clicked.  The count for the set
will then be displayed in the label.  You can probably use the same
code, although I didn't test it, for the onColExit in the dbGrid for
the Master file.  Any further questions please Email.
Ben
Arrow

Other Threads