Default value for a Form field

Is there any way to set up a default value in a form field or do you have to do it in the table design??

Thanks in advance,


There are a number of ways to do it. The one I like most is where you write a function called InitializeNewRecord or something like that in the table. Then you would call the function from OnInsert, but that only works well if the form’s DelayedInsert property is turned off. There’s always InitValue on field design, but that is also not always the right solution. I just had an issue where I had put InitValue of a boolean to Yes, and then months later I was assuming because it was a boolean that the initialized value was false, and so my logic was reversed. You gotta be careful with these things :).

I don’t like data code on forms, so I always try to find a solution that doesn’t involve writing data code on forms, but if your form has to have DelayedInsert on, than you could add a call to that function in the OnNewRecord trigger of the form.

Let me try the InitValue first and then we’ll see.

Thanks Daniel,