Board index » delphi » How to fire OnFilterRecord event from another control

How to fire OnFilterRecord event from another control

I have a ttable with Filtered=true, and code in the OnFilterRecord to
select only records where a date field = Calendar1.CalendarDate. It
filters on form creation, and when I add/delete records.

But I also want it to filter after the OnChange event of Calendar1, so
the grid will show only records from the newly-selected date.  Problem
is, my ttable ( and therefore the OnFilterRecord procedure) is on a
DataModule, so the OnFilterRecord procedure doesn't show up in the drop
down list of Calendar1's OnChange event.

I've tried a few things w/o success.  

Thanks in advance for any guidance.

Glenn Galbraith

 

Re:How to fire OnFilterRecord event from another control


Have you tried Table1.Filtered := FALSE;
                        Table1.Filtered := TRUE;
or

        Table.Close;
        Table.Open;

John

Quote
gglo...@pcisys.net wrote:
>I have a ttable with Filtered=true, and code in the OnFilterRecord to
>select only records where a date field = Calendar1.CalendarDate. It
>filters on form creation, and when I add/delete records.

>But I also want it to filter after the OnChange event of Calendar1, so
>the grid will show only records from the newly-selected date.  Problem
>is, my ttable ( and therefore the OnFilterRecord procedure) is on a
>DataModule, so the OnFilterRecord procedure doesn't show up in the drop
>down list of Calendar1's OnChange event.

>I've tried a few things w/o success.  

>Thanks in advance for any guidance.

>Glenn Galbraith

Other Threads