OnValidate event of TField firing recursively

2003-10-28 04:34:00 AM
Hi group,
I am developing DB App with D7. My problem is this.
I have a master-detail Sales Invoice form. When the form opens I want to
fill the Invoice number field with LastInvNumber+1. It is easy and I have
done it.
I have OnValidate event for Invoice# field. It checks if invoice number,
that is typed, if already exists then open it otherwise consider it new
Invoice and start input.
As I assign value to INV_NO field or TDBEdit it fires the OnValidate event
It want that if I assing value to TDBEdit Text or Value property then
OnValidate should not fire. I have tried DisableControls/EnableControls but
all in no desied result.
Is there a way that I assign a value to TDBEdit and it only shows it in the
control but does not post it DB.
Please help I have designed more than 100 forms and now implementing code
and having no way out.
I have used DevExpress Editors and then have EditingText property wich do
the desired job but I can't use those components due to "Stay With Native"
rule for the current App.
Have a nice day.
S Bokhari