AndrewMozley
Programmer
I have an application with a textbox in which a customer account code can be entered. (this text box is based on a class used within the application). The Valid() method of this particular control – call it txtCust - will do several things, including helping the user to search for suitable customers, displaying the name if the account code is valid, warning the user if the account code is not valid.
But in some cases we do not need to validate the account code : For example the user may have decided to open another form to look at recent sales transactions to check the likely customer code.
What is the best way to handle this requirement?
At present there is an (application-wide) Leaveform() function which can be invoked in the Valid() method. This checks - SYS(1270) - to see whether the mouse has been clicked outside the present form - perhaps to call a different enquiry form.
In this case txtCust.valid() calls Leaveform(). If this returns .T., the Valid() method returns .T. irrespective of txtcust.value.
I would be interested how other users handle this matter of when to validate a control; grateful for guidance.
Andrew
But in some cases we do not need to validate the account code : For example the user may have decided to open another form to look at recent sales transactions to check the likely customer code.
What is the best way to handle this requirement?
At present there is an (application-wide) Leaveform() function which can be invoked in the Valid() method. This checks - SYS(1270) - to see whether the mouse has been clicked outside the present form - perhaps to call a different enquiry form.
In this case txtCust.valid() calls Leaveform(). If this returns .T., the Valid() method returns .T. irrespective of txtcust.value.
I would be interested how other users handle this matter of when to validate a control; grateful for guidance.
Andrew