DisplayFormat
-
Rober Watson
- Posts: 7
- Joined: Tue 02 Sep 2008 16:14
DisplayFormat
Using myQuery and D2007.
Opening table when the app opens, using OnCreate event.
(Active:=TRUE;)
I have a "costs" field. I would like to specify the displayFormat so that it contains a $ .
How do I do this?? Prior to mySQL, I used XBase tables. I could cause the Fields objects to be created before run time and then set the DisplayFormat of the Fields. I don't know how to do this now with mySQL and Devart's myQuery object.
Thanks for any help,
Bob
Opening table when the app opens, using OnCreate event.
(Active:=TRUE;)
I have a "costs" field. I would like to specify the displayFormat so that it contains a $ .
How do I do this?? Prior to mySQL, I used XBase tables. I could cause the Fields objects to be created before run time and then set the DisplayFormat of the Fields. I don't know how to do this now with mySQL and Devart's myQuery object.
Thanks for any help,
Bob
-
eduardosic
- Posts: 387
- Joined: Fri 18 Nov 2005 00:26
- Location: Brazil
Re: DisplayFormat
Try thisRober Watson wrote:Using myQuery and D2007.
Opening table when the app opens, using OnCreate event.
(Active:=TRUE;)
I have a "costs" field. I would like to specify the displayFormat so that it contains a $ .
How do I do this?? Prior to mySQL, I used XBase tables. I could cause the Fields objects to be created before run time and then set the DisplayFormat of the Fields. I don't know how to do this now with mySQL and Devart's myQuery object.
Thanks for any help,
Bob
Code: Select all
TFloatField( MyQuery.FieldByName( 'Vl_Money' )).DisplayFormat := '#,##0.00';
-
Rober Watson
- Posts: 7
- Joined: Tue 02 Sep 2008 16:14
-
Rober Watson
- Posts: 7
- Joined: Tue 02 Sep 2008 16:14
Re: DisplayFormat
_______________________________eduardosic wrote:Try thisRober Watson wrote:Using myQuery and D2007.
Opening table when the app opens, using OnCreate event.
(Active:=TRUE;)
I have a "costs" field. I would like to specify the displayFormat so that it contains a $ .
How do I do this?? Prior to mySQL, I used XBase tables. I could cause the Fields objects to be created before run time and then set the DisplayFormat of the Fields. I don't know how to do this now with mySQL and Devart's myQuery object.
Thanks for any help,
Bob
Code: Select all
TFloatField( MyQuery.FieldByName( 'Vl_Money' )).DisplayFormat := '#,##0.00';
Thanks - worked perfect.
I also did a
TFloatField( DM.myDefinedClasses.FieldByName( 'costs' )).currency := TRUE;
which had no affect (best I can tell). I thought currencey put the $-mark
Apparently not. I used a displayFormat of '$ #,##0.00' and it worked
fine. Thank you - Bob
- Drop the TMyQuery component on a form.Rober Watson wrote:___________________Dimon wrote:You can create field objects in desing time using the "Fields Editor" pop-up menu of TMyTable or TMyQuery.
That is what I was trying to do, but it is
not clear to me how to do it. Can you
explain further please? Maybe "click by click".
Thanks,
Bob
- Set the SQL property.
- Right-click on the component to open pop-up menu.
- Click on the "Fields Editor..." menu.
- Right-click in the open window to call the pop-up menu.
- Select "Add all fields" item.
After this you will be able to set the DisplayFormat property in desing time.