Re:A couple of questions
Quote
Brian Clark <br...@qcomm.com> wrote:
>1. Does anyone have any hints for working with memo fields in tables?
> Specifically, how can I copy a memo in one table to another. With
> a string I would use table1.fieldByName('strField').asString:=
> table2.fieldByName('stuff').asString;
I have found that using memory streams is the simplest way to work
with memos. Here is an example procedure. It will append a message
from a "Purchase Order Message Library" to the current "Purchase Order
Message" memo field:
procedure TfrmPOMaint.AppendMsg(Sender: TObject);
var
S : TMemoryStream;
begin
if tblPOMsg.State in [dsInsert, dsEdit] then tblPOMsg.Post;
tblPOMsg.Edit;
S := TMemoryStream.Create;
try
if fldPOMessage.TextLength > 2 then
tblPOMsgMessage.SaveToStream(S);
tblMsgLibMessage.SaveToStream(S);
tblPOMsgMessage.LoadFromStream(S);
fldPOMessage.Refresh;
finally
S.Free;
end;
end;
Hope this helps,
Phil
"Due to recent cutbacks, the light at the end of the tunnel has been
turned off."