L
lmcc via AccessMonster.com
I didn't think about all the possibilties. That's over my head. And, I am
following the example in the books I read, which does not address all the
various possibilities of closing a form.
The form is no longer getting that error message 3021.
There is no other code or macros behind the form.
following the example in the books I read, which does not address all the
various possibilities of closing a form.
The form is no longer getting that error message 3021.
There is no other code or macros behind the form.
Dirk said:[quoted text clipped - 38 lines]Hi Dirk,with
someone else.
You're welcome, but I don't think you should consider the matter settled
yet. Your code will successfully prevent closing the form and saving the
record if the agency is not chosen, but *only if the form is closed by your
cmdOK button*. What if the user closes the form by clicking the "X" button
in the title bar? What if the user presses Alt+F4, or clicks menu item
File --> Close to close the form? What if the user presses Shift+Enter to
save the record without closing the form, or clicks menu item Records ->
Save Record?
If you want to prevent an incomplete record from being saved, then you
really need to be using the form's BeforeUpdate event to do the validation.
Everything else is secondary. The code we had worked up before was fine, so
far as it went, except that something as yet unidentified was causing error
3021 to be raised. If I were in your position, I would be addressing that
specific error to identify its cause. *Then* you could decide whether to
fix it or ignore it.
To that end, I have asked you repeatedIy to post any other code or macros
behind the form, but you haven't done so. There's no guarantee that having
that information would let me solve the 3021 error, but not having it ties
my hands as far as helping you goes. All I can do at this point is warn you
that the code you posted above doesn't meet your requirements in all cases.