DelphiFAQ Home Search:

How to specify a DefaultExpression for a TField object


comments13 comments. Current rating: 3 stars (9 votes). Leave comments and/ or rate it.

If you set up a field attribute set and associate that set with a field in your table that will
work. If you set the value in the object inspector it will let you enter in a string but it will not
reflect the value at runtime. If you try to set the TField.DefaultExpression property at
runtime like this:

MyField.DefaultExpression := 'MyValue';  // (Wrong)
It will compile but you will not get a default value at runtime when you create a new record
in the table by, say, clicking on the + on the DBNavigator. To get the default value to take
at runtime the code assignment needs to be:

MyField.DefaultExpression := '''MyValue'''; // (Correct)
In the Object Inspector you just need to put 'MyValue'. Use single quotes in the Object


2020-06-27, 23:58:58
Mark from Frankfurt Am Main, Germany  
viagra for men
2020-06-30, 19:57:05
John from United Kingdom  
coupon for bimatoprost
2020-07-01, 18:45:27
Ashley from Greece  
clomid for sale at walmart
2020-07-18, 08:51:13
Judith from Ukraine  
2020-07-19, 04:49:12
Tamera from Uzbekistan  
cialis website
2020-07-29, 08:38:06
antibiotics for cats without an rx
2020-07-29, 21:05:38
prednisone for sale next day delivery
2020-07-31, 01:24:01
Archie from Greece  
when will cialis be available in generic



NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: