basically i've got an Unbound form, with a name field. I've also got a validation rule for name in the properties section on the form, stopping it from accepting zero length strings values.
Here's the thing :
if you open the form, leave the name field blank and click save, it saves !! This is NOT good.
However:
If you open the form, type some data into the field, then delete it ALL, then click save, it will fire the validation rule ?? Weird !!
Actually, it's not weird at all. It's exactly the way Access was designed, and exactly the way it's described in the documentation. What's happening is that the event doesn't fire unless you update the control. That's why it's called the AfterUpdate event.
There are a few ways to deal with this. The one that makes the most sense to me is to put the code you want to run in a function in the form's module. Then you can call that function from both the AfterUpdate of the control and the AfterUpdate of the form. Actually, though, you might want to use the BeforeUpdate, so that you can cancel the event, if the function returns an appropriate value (such as False).
Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.