I want to validate the fields on a form over and above the definitions that exist in the data definition (i.e. numeric, must be filled in etc).
I thought all I needed to do was put a bunch of ifs and elses in the beforeupdate part of the form with a setfocus a cancel = true possible a me.undo and maybe a message telling the user what the problem is.
I want to remain on the form so the error can be corrected. This works if trying to move to another record using the navigation bars. I do have a slight problem as I have a combo box which allows me to jump to a specific record but I'll post about that later.
I also have a button on the form which closes the form. This is where the problem lies. If I introduce an error and then click the close button I get my error message, the field in error is restored but the form is then closed. I want it to remain open. Do I need my validation in both places (before update and also in the event for the button) or have I completely lost it.
I thought all I needed to do was put a bunch of ifs and elses in the beforeupdate part of the form with a setfocus a cancel = true possible a me.undo and maybe a message telling the user what the problem is.
I want to remain on the form so the error can be corrected. This works if trying to move to another record using the navigation bars. I do have a slight problem as I have a combo box which allows me to jump to a specific record but I'll post about that later.
I also have a button on the form which closes the form. This is where the problem lies. If I introduce an error and then click the close button I get my error message, the field in error is restored but the form is then closed. I want it to remain open. Do I need my validation in both places (before update and also in the event for the button) or have I completely lost it.