I have a form, CUSTOMER , with various fields e.g. custid, fname, sname, address ...etc
When saving a new record I wish for it to check all of these fields to see if they are NULL or NOT NULL, if any one of these fields are NULL a error message will be displayed e.g. "data not entered" and if they are NOT NULL the record will be saved successfully.
Any help / point in the right direction would be greatly appreciated
I would suggest using the Pre-Insert and Pre-Update combination of triggers or the Key-Commit trigger. In these triggers you can check to see if any of the fields are NULL. However, if the fields are required, why not just set the Required property of each field to Yes. This ensures they can't leave the field without a value and the Commit process will automatically check required fields without having to write any code.
Thanks for the advice! But there is one problem with this, say for example I type in a field, click tab or the next field, then want to go back to that field, it will not let me - I gather this is because the field I am currently in is blank and does not have any data in it! Is there a way around this?
Any help with the message appearing. When I successfully commit a record it displays it in the bottom left hand corner and I want this to be displayed in a message box for the user to see clearly. Is it something along the lines of:-
You can defer enforcement of the Required property until validation of the record by setting the Module property Defer Required Enforcement to Yes. This allows you to navigate within the record - moving from Field to Field. If you attempt to leave the record, then the required field(s) will then be validated and any Item level When-Validate-Item trigger(s) will fire. This property defaults to No - so each item is validated imediately.