Board index » delphi » DisplayFormat

DisplayFormat

I'm having trouble setting the DisplayFormat-property for an at
runtime-generated table. It seems that I can't use
TTable.Fields[4].DisplayFormat := '#####.##'.

Does anyone know how to solve this ?

Thanks in advance

--
Arthur Habraken
Zwaag, The Netherlands
d...@worldaccess.nl

 

Re:DisplayFormat


In article <01bb902e$5450d6e0$d6854...@duri35.worldaccess.nl>, From
"Arthur Habraken" <d...@worldaccess.nl>, the following was written:

Quote
> I'm having trouble setting the DisplayFormat-property for an at
> runtime-generated table. It seems that I can't use
> TTable.Fields[4].DisplayFormat := '#####.##'.

> Does anyone know how to solve this ?

> Thanks in advance

You do not have access to the Tfields until you create them try:

{Table must not be open to create TFields}

Table1.Active := False;

{Calling update will gain access to all of the fields}

Table1.FieldDefs.Update;

{if TField is not yet created then create it}

if Table1.FindField('ACCTNO') = nil then
    MyField := Table1.FieldDefs.Find('ACCTNO').CreateField(Owner);

Table1.Active := True;

{Now have access to Tfield properties}

Table1.FindField('ACCTNO').DisplayWidth := 10;

{ and so on.....}

God Bless,

--
Jay Schwisow j...@weldnet.com
08/24/96 14:16
---------
Using: OUI PRO 1.5.0.2 from http://www.dvorak.com

Other Threads