Solved

Compare string in a memo, for filtering

Posted on 2001-07-30
7
415 Views
Last Modified: 2010-04-06
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.Table1FilterRecord(DataSet: 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.
0
Comment
Question by:syloux
7 Comments
 
LVL 3

Accepted Solution

by:
nnbbb09 earned 50 total points
ID: 6335499
Try this. It assumes that you have a field called memo in Table1.

Begin
  Accept := Pos('Hello world', Table1.FieldByName('Memo').AsString) > 0 ;
End ;
0
 
LVL 22

Expert Comment

by:mnasman
ID: 6335559
Hello

Try sametext funcation

Procedure TDataModule1.Table1FilterRecord(DataSet: TDataSet; var Accept: Boolean);
Begin
Accept := SameText('HelloWorld',Table1['urField'])
End ;

Best regards
Mohammed Nasman
0
 

Author Comment

by:syloux
ID: 6335607
Always have this error message :

Cannot access field 'Memo' in a filter  :(((

0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 6335794
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.FieldByName('Memo')).AsString) > 0 ;
End ;

meikl ;-)
0
 

Expert Comment

by:x4
ID: 6398527
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;
0
 
LVL 26

Expert Comment

by:Russell Libby
ID: 8734986
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
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now