select line from memo field to print
I have a report with a memo that has many lines, but I want to select only the one that has 'room' in it for printing. I've tried:
[RoomText] ... in the variable window, and code of:
Begin
j := [Query1."Memo1".lines.count]; << errors here, don't know how to count
RoomText := '';
For I := 0 to j
WkText := [Query1."Memo1".Lines];
if Pos('ROOM', Upper(WkText)) > 0 then RoomText := WkText;
end;
So my question is how do I get a single line from a memo field if it contains text I am seeking?
Thanks, sorry the formatting gets lost at post, though.
[RoomText] ... in the variable window, and code of:
Begin
j := [Query1."Memo1".lines.count]; << errors here, don't know how to count
RoomText := '';
For I := 0 to j
WkText := [Query1."Memo1".Lines];
if Pos('ROOM', Upper(WkText)) > 0 then RoomText := WkText;
end;
So my question is how do I get a single line from a memo field if it contains text I am seeking?
Thanks, sorry the formatting gets lost at post, though.
Comments
j := [Query1."Memo1".lines.count];
you cant do this here
you are confusing the contents of the field with a Fr memo(Text object)
you can't access it directly.
ie fieldname j := [Query1."Memo1"] first since it is in a query you would better to and an as operator in your query to give the field another name or create a variable '' notes",in fr and point it to the datafield. it will help to avoid name confusion.
now databand with an fr memo5(text object) containg variable [notes]
can be accessed from the obp of the band using memo5.memo.lines[indx].
or from the script of the memo5.memo itself using memo.lines[indx].
regards