The form is associated to a table with a field of type date. All I want it to do is to automatically populate the field with today's date.
So I just assign the "InitValue" in the table properties to "t", but this obviously does not work when ever the user creates a new record.
0
Comments
When the user enters a new record on OnValidate of the field add:
Datevar := TODAY
It will be automatically populated with today's date.
So...
You definately want to program it on the table level, unless this is behaviour you want on this one form only. The trigger you're looking for is the OnInsert trigger. All you need to do is add a line: It won't be populated right when you hit F3, but as soon as the record is written to the database, you'll see it. Most of the time, this will be enough, because the record in master tables should be inserted when you enter the primary key anyway.
RIS Plus, LLC
On those forms I would suggest putting the code in "Form - OnNewRecord"