Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBMemo field in DBGrid 1

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
I have a paradox table with a memo field. I want to display the contents of the memo field in a DBGrid without any additional components. How can I show this?

Thanks for any help!

Leslie
 
The simple answer is, you can't. However, there is a way to show part of the memo... Create a calculated field that's 254 characters wide. In the OnCalcFields event handler for the table, put something like the following:
Code:
MyTable.FieldByName('CalcNote').AsString := substr(MyTable.FieldByName('MemoField').AsString, 1, 254);
This will display the first 254 characters of your memo.

-D
 
put the following code in the OnGetText event of the memo field:

Code:
Text:=Sender.asString;

TDBGrid displays the text property of fields. TField.Text returns "[MEMO]" for a memo field by default, as you usually see. By using the OnGetText event you can modify the behaviour of the Text property to return the value you require.

Have fun
Simon
 
worked like a charm Simon! Thanks,

leslie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top