Page 1 of 1

Does anyone know how to set default value for DBEdit?

PostPosted: September 7th, 2005, 7:16 am
by ssfftt
I have a DBEditPrice that represents the price of a service, how can i set its default value to 0 when i want to add a new service?

PostPosted: September 7th, 2005, 9:02 am
by Stefan
Normally you would do this at the database end:

CREATE TABLE Tab (
MyField Numeric(10,2) DEFAULT 0,...

PostPosted: September 7th, 2005, 10:10 am
by Kambiz
In addition to what Stefan suggested, you can set the default value using the OnNewRecord event of the table.

done!

PostPosted: September 7th, 2005, 2:58 pm
by ssfftt
well, i did it this way:

IBQServicePRICE.Value := 0;

thanks for all your advices