Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / July 2007

Tip: Looking for answers? Try searching our database.

Before Update Event Undo problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jazzbah@gmail.com - 06 Jul 2007 10:28 GMT
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
value you entered isn't valid for this field" and leaves the focus
remaining in the text box, with the offending text (or in this case a
date) in tact with the cursor blinking in the field.  I have tried
using the me.txtOrderDt.undo, but it seems that the system message
overrides this and the undo event does not happen.  Ideally, I would
like to see the text box undone and returned to the existing value
that was in the box before the invalid text was entered.  Can I bypass
this system message?  How do I achieve what the user could achieve if
they pressed the Esc key?
Thanks
David G
kingston - 06 Jul 2007 15:10 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.