I have a form that users enter in data on. I am running validation on those controls using an "event procedure". I placed the code in the BeforeUpdate of the form. I have a customized menu that if the user clicks "Home", for example, it takes them to the main form (not the form that the data is getting validated on).
Here is the problem. If I use the Cancel = true in the beforeupate it seems to work just fine but it still closes out the form and goes to the main form. What I want is that if someone leaves a control blank and they get a message box saying which control they need to correct (code that I have works fine for that part) then have it cancel the update and stay on the current form. i.e. ignore my customized code to take them back to "home".
By way of comparing, if I do an incomplete form and click the "X" to close out of access it gives me a message saying something to the effect that the record can't be saved and if I hit no, it stays on the form and doesn't do anything.
-Stoss
Here is the problem. If I use the Cancel = true in the beforeupate it seems to work just fine but it still closes out the form and goes to the main form. What I want is that if someone leaves a control blank and they get a message box saying which control they need to correct (code that I have works fine for that part) then have it cancel the update and stay on the current form. i.e. ignore my customized code to take them back to "home".
By way of comparing, if I do an incomplete form and click the "X" to close out of access it gives me a message saying something to the effect that the record can't be saved and if I hit no, it stays on the form and doesn't do anything.
-Stoss