Hi Wallace,<br><br>Don't know if you missed my post or not but if you do your validation on the OnDataChange event on the TDataSource component, it gets triggered everytime you modifiy a field value. So if you are in a DBGrid and you change a value in a column and then move to the next column, the event is fired.<br>
<br>OnValidate happens before posting but OnDataChange occurs whenever a field is modified of if you scroll to new record.<br>If you move to a new record you just ignore it by testing the Field parameter is nil.<br><br>Cheers,<br>
Colin<br><br><div class="gmail_quote">On 2 June 2011 18:00, Marshland Engineering <span dir="ltr"><<a href="mailto:marshland@marshland.co.nz">marshland@marshland.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#ffffff"><div class="im">
<div>>Form inheritance or Frames to cut <br>>down on the number of
different entry points.</div>
<div> </div>
</div><div><font face="Arial" size="2">The program is set of sequences for machining. A
DBGrid displays the operations.</font></div>
<div><font face="Arial" size="2">
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">On double clicking the DBGrid operation, opens
a form with the relevant data and the graphics is displayed.
</font></div>
<div><font face="Arial" size="2">The data entry points are placed on the graphic at
the point of interest. So each entry form is completely different. </font></div>
<div> </div>
<div>The machining steps are </div>
<div> </div></font></div>
<div><font face="Arial" size="2">Thread, Rough Turn, Plunge cut, Face etc and
all can be internal as well.</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">However for example - each form has a Depth Of Cut
that has a range of 0.02 -2.5 mm. </font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">My thoughts </font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">-Create a new DB aware component that has a maximum
and minimum range and use it on each form. Not ideal as I have to ensure
consistency between all forms. </font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">-If I use OnValidate in the DM, when is this event
triggered? On Post ?</font></div>
<div><font face="Arial" size="2">If so then I could have several errors
occurring at the same time when the data validated, which
error belongs to which field ? </font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">If I use OnValidate - when I append a record, will
it run all the OnValidate procedures at once ?</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">It looks like I may have to split the operation
into to parts - check that the data entered is in the correct format (Form
Property) and another to check it is in the right range (Database
Property)</font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">PS Why Delphi didn't have a DBEditNumeric or
EditNumeric component I'll never know. </font></div>
<div><font face="Arial" size="2"> </font></div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2">Thanks Chaps. </font></div>
<div> </div>
<div><font face="Arial" size="2"></font> </div>
<div><font face="Arial" size="2"></font> </div></div>
<br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@delphi.org.nz">delphi@delphi.org.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@delphi.org.nz">delphi-request@delphi.org.nz</a> with Subject: unsubscribe<br></blockquote></div><br>