Hello,
I want to count the no. of records selected in a Tablebox. (Selected, not marked)
If No. selected eq 1 i need to get info out of this record (thats easy), and when No. > 1 do nothing. (thats the tricky part cause i cant find a way to count the number of records selected)
Any help is much appreciated.
Screenschot:
https://mail.rainbowsolutions.nl/CHE6004679.GIF
Thanks
Peter
Comments
Editable: No
SourceExpression: COUNT
Even if you set any filters, this field will be updated automatically.
Is this the solution of your problem?
Regards
Michael
Also, the textbox may only be filled with the first record selected. So if more that one record selected, nothing may happen after the first selected.
Perhaps that might help in some way??
Because the event needs to be triggered at OnAfterGetCurrRecord, the subform, remains empty BEFORE anything can be selected (because the fitler is set to MARKEDONLY).
Best thing would be to:
1. SETSELECTIONFILTER
2. Count records within the filter
3. Programming logic to update the field
4. Reset FILTER to what it was before point 1.
I only don't know how to achieve this, every time i tried something like this, my subform remained ampty, before anything was selected.
Create a local variable -- 'MyRec', type Record, subtype <same record as the form>.
Then in the trigger, do something like this: Because the SETSELECTIONFILTER is applied to MyRec, the form's Rec is left undisturbed...
Peter