Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Number of records in a grid
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00575563
Message ID:
00575609
Vues:
20
>>>With a relationship from parent table to child table and a grid's recordsource is the child table. Buffermode set to 5 and option to add records to the child table. The records show up in the grid as they are added, but how do you determine out how many records are present in the grid without doing a tableupdate on the child table?
>>>
>>>Thanks in advance for any help!
>>
>>RECCOUNT(grid's recordsource)
>Thanks for the suggestion, but will tell me what table contains for records.
>
>the child table has numerous records, but I only need the records showing in the grid. Buffering is 5 so the added records are not committed. What I need is a way to determine the number of records in the grid (what is showing) before I do the tableupdate! Problem I have is that the grid is in a class container, and the class needs to report back status of number of records at any time. I have the records initially, but then by adding and deleting records, a way to report the actual records present has been my problem.

It sounds as though your are using a filter or something like it on the child grid source. If so, you can create a method in the grid class that does the following:

1. Set Form.Lockscreen = .T. to avoid users seeing record pointer bouncing around
2. Save current record position (this can use recno or the PK value of the record)
3. Issue a GO TOP/LOCATE
4. Issue a COUNT TO < some variable >
5. Reposition record pointer
6. Set Form.Lockscreen = .F.

If you are not using parameterized views for the child grids that limit the number of records, you have to use something like COUNT which will act on the buffered data to determine total number.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform