Re: OnFilterRecord




"Bruce Roberts" <ber@xxxxxxxxxxxxxxxxxxxxxx> wrote in message news:5%Mbe.3825>
var m : tFilterRecordEvent;

m := FindName;
if @OnFilterRecord = @m . . .

Thank you, the debugger accepts the following code, but I think it is a bit clumsy ...
In this procedure some addresses are searched (OnFilterRecord:=FindAddress;). When entering it there may be a filter on, either FindName or FindNames. At the end this original filter have to be set on and its name is saved in a variable sFilter.
..
var sFilter :string;
ok :boolean;
bok :TBookmarkStr;
FilterMeth :TFilterRecordEvent;


begin
With aTable do begin
sFilter:='';
try
If filtered then begin
if Assigned(OnFilterRecord) then begin
FilterMeth:=FindName;
if @OnFilterRecord = @FilterMeth then sFilter:='FindName' else begin
FilterMeth:=FindNames;
if @OnFilterRecord = @FilterMeth then sFilter:='FindNames';
end;
end;
end;
bok:=Bookmark;
OnFilterRecord:=FindAddress;
filtered:=true;
FindAddress(aTable,ok);
finally
filtered:=false;
If sFilter<>'' then begin
if sFilter='FindName' then OnFilterRecord:=FindName
else if sFilter='FindNames' then OnFilterRecord:=FindNames;
filtered:=true;
end;
Bookmark:=bok;
end;
end;
end;


.



Relevant Pages

  • Re: OnFilterRecord
    ... When entering it there may be a filter on, either FindName or FindNames. ... At the end this original filter have to be set on and its name is saved in a variable sFilter. ... bok: TBookmarkStr; ... if ATable.Filtered then OldFilter:= ATable.OnFilterRecord ...
    (alt.comp.lang.borland-delphi)
  • Re: Filter in my form
    ... When I am entering new records it will show 1 of. ... It used to have a filter in the table ... bars back on the subforms. ... Allen Browne - Microsoft MVP. ...
    (microsoft.public.access.forms)
  • Re: Sorting issues-Need help bad!!!
    ... Sorting property to arrange the data to your liking. ... > entry at the end of the DB and not in the correct slot. ... > understand is.before entering a new record, I do a filter by selection ...
    (microsoft.public.access.forms)
  • Re: linking forms
    ... entering in using an option group. ... You might be able to do this using the built-in "filter by form" function on ... then, in filter by form mode, all available tasks would be listed for you to ...
    (microsoft.public.access.forms)
  • Re: In Access 2007 why does info disappear?
    ... I did not set a filter. ... As I was entering the next employee name the first record disappeard. ... or the table datasheet? ...
    (microsoft.public.access.gettingstarted)