syloux
asked on
Compare string in a memo, for filtering
I have a paradox table with a memo. I need to find records containing a certain text in the memo.
I'm using a OnFilterRecord to do that.
Procedure TDataModule1.Table1FilterR ecord(Data Set: TDataSet; var Accept: Boolean);
Begin
Accept := Pos('Hello world', Table1.Memo.Text) ;
End ;
But it do not work. I have an error message telling the memo can not be access in a filter.
How can I do that ???
Thank you.
I'm using a OnFilterRecord to do that.
Procedure TDataModule1.Table1FilterR
Begin
Accept := Pos('Hello world', Table1.Memo.Text) ;
End ;
But it do not work. I have an error message telling the memo can not be access in a filter.
How can I do that ???
Thank you.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Always have this error message :
Cannot access field 'Memo' in a filter :(((
Cannot access field 'Memo' in a filter :(((
if nnbbb09 comment not work, then it could be impossible,
except you don't have replaced 'Memo' with your real fieldname
but, maybe this helps, (just modified nnbbb09 comment, not tested)
Begin
Accept := Pos('Hello world', TBlobField(Table1.FieldByN ame('Memo' )).AsStrin g) > 0 ;
End ;
meikl ;-)
except you don't have replaced 'Memo' with your real fieldname
but, maybe this helps, (just modified nnbbb09 comment, not tested)
Begin
Accept := Pos('Hello world', TBlobField(Table1.FieldByN
End ;
meikl ;-)
I just tested nnbbb09 comment and it works fine.
Created a form a table a source a grid and a button.
The grid displays the COMPONENTTYPE Field of the table.
When you turn on the filter only the Records in the
table that have 'COMPUTER' in them show.
************************** ********** ********** *********
procedure TForm1.Table1FilterRecord( DataSet: TDataSet;
var Accept: Boolean);
begin
Accept := Pos('COMPUTER', Table1COMPONENTTYPE.Value) > 0;
end;
************************** ********** ********** ********
procedure TForm1.Button1Click(Sender : TObject);
begin
Table1.Open;
Table1.Filtered := True;
Table1.Refresh;
end;
Created a form a table a source a grid and a button.
The grid displays the COMPONENTTYPE Field of the table.
When you turn on the filter only the Records in the
table that have 'COMPUTER' in them show.
**************************
procedure TForm1.Table1FilterRecord(
var Accept: Boolean);
begin
Accept := Pos('COMPUTER', Table1COMPONENTTYPE.Value)
end;
**************************
procedure TForm1.Button1Click(Sender
begin
Table1.Open;
Table1.Filtered := True;
Table1.Refresh;
end;
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept nnbbb09's comment as answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Thank you,
Russell
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
Accept nnbbb09's comment as answer
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Thank you,
Russell
EE Cleanup Volunteer
Try sametext funcation
Procedure TDataModule1.Table1FilterR
Begin
Accept := SameText('HelloWorld',Tabl
End ;
Best regards
Mohammed Nasman