Delphi32.com - Home!
| Home/News | Downloads | Forums | D32 Magazine | Resources | Info and Facts |  
 
 Specify a DefaultExpression for a TField object


How do I specify a DefaultExpression for a TField object?   

    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'; 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'''; In the Object Inspector. You just need to put 'MyValue'. Use single quotes in the Object Inspector.

     



  << Previous Faq     Complete List     Next Faq >>  



 
 Hits/month  2,500,000+ 
 Downloads
 (Since May 2000)
 7,393,709 
 Total Files  6,023 
 Forum msgs  7,670 
 Articles/FAQs  70+/900+ 
Kylix
Tips n Tricks
FAQs
Knowledge Base
Bug Listings
Articles
Books
Newsgroups
Links
Submissions
Testimonials
Advertising
Contact Us
About Us
Search Amazon:
Top Selling Software at Amazon

| Home/News | Downloads | Forums | Resources | Info and Facts | Testimonials |
  Site Search:
 


Comments/Problems: Webmaster@delphi32.com
Copyright © 1998-2006, Delphi32.com. All rights reserved.
Terms of Use