What exactly is preventing the update? Is it because the input is of the
incorrect type or is it that the data is invalid? Does the message result
from validation you are performing? You should be able to do a Cancel = True
in your BeforeUpdate event, but this will not revert the input. Consider the
case if it did - the user would enter in bad data that he thought was good
and the program would automatically reset it. Unless he knew that the
program was supposed to do this, he might suspect that the application was
broken. In cases where the user is trying to enter bad data that he thinks
is good, he will definitely think that the application is broken. I suggest
that you add an alert message that tells the user the data is bad and to
force him to fix it, perhaps via the Escape key. If your problem is a result
of a validation that you do, you could allow the update and then reset the
value using the property OldValue.
>I'm trying to program the Before Update Event for a text box on my
>form. I seem to be getting thwarted by a system message like, "The
[quoted text clipped - 9 lines]
>Thanks
>David G
jazzbah@gmail.com - 19 Jul 2007 09:14 GMT
On Jul 7, 12:10 am, "kingston via AccessMonster.com" <u27511@uwe>
wrote:
> What exactly is preventing the update? Is it because the input is of the
> incorrect type or is it that the data is invalid? Does the message result
[quoted text clipped - 27 lines]
> --
> Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/access-forms/200707/1
Thanks for your response,
I didn't even realise that I got a response. I'm a user groups
newbie.
OK, it was the system error message in response to invalid data.
which overwrote my msgbox.
I did some further research and it was pointed out to me that I needed
to use the Form_Error event.
I could then trap the error with that event and the Before Update then
worked perfectly.
Thanks again
David G