Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-access > #9186

Re: Need to cancel the update to a bound form if edits fail (Access 2010)

From "Access Developer" <accdevel@gmail.com>
Newsgroups comp.databases.ms-access
Subject Re: Need to cancel the update to a bound form if edits fail (Access 2010)
Date 2014-03-24 12:47 -0500
Message-ID <bpb9dmFg61jU1@mid.individual.net> (permalink)
References <atvri9t1mnupssoccgf1g81d8mqbm67utk@4ax.com> <a93fbd13-a8a3-4612-9622-b75839f67856@googlegroups.com> <nkm0j9tk5imolfeo8t0stsmg9h9b751t78@4ax.com>

Show all headers | View raw


"PW" <emailaddyinsig@ifIremember.com> wrote

 > I was doing that and the record was
 > getting saved w/o passing edits.
 > Put the Undo in the BeforeUpdate
 > event?

There are several things that can cause the record to be updated, to wit, 
moving focus to a Subform control or an explicit save via keypress or code 
action, and moving off the current record to another record, or closing the 
form. You can't stop an Update in the After Update event because, of course, 
the update has already occurred. If you want to cancel, you must do so 
before the update occurs.

 > And isn't that just for new
 > records?

No, Before Update event applies to all records being written. Before / After 
Insert applies only to new records.

 > What if the user blanks out a
 > required field in an existing record?

As best I remember, if you defined the field as required in the table 
definition, the database engine will enforce that, and will not write a 
record without the field.

 > By the way, I saw many examples
 > from a search and they all do me.Undo,
 > and then Cancel=True.  Cancel=True
 > would not allow me to exit the form
 > using the X/Close button.  I don't even
 > know what it is supposed to do.

Cancel = True does exactly what it says... it cancels writing / updating the 
record.  I believe it does, by design, return you to the form.  If there's 
still data in the form, and there's a problem that prevents the record being 
written, closing the form will not work.

   Larry Linson
     Microsoft Access MVP
     Co-Author, Microsoft Access Small Business Solutions, pub. by Wiley 

Back to comp.databases.ms-access | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Need to cancel the update to a bound form if edits fail (Access 2010) PW <emailaddyinsig@ifIremember.com> - 2014-03-22 15:30 -0600
  Re: Need to cancel the update to a bound form if edits fail (Access 2010) Patrick Finucane <patrickfinucanetx@gmail.com> - 2014-03-24 07:53 -0700
    Re: Need to cancel the update to a bound form if edits fail (Access 2010) PW <emailaddyinsig@ifIremember.com> - 2014-03-24 10:22 -0600
      Re: Need to cancel the update to a bound form if edits fail (Access 2010) "Access Developer" <accdevel@gmail.com> - 2014-03-24 12:47 -0500
        Re: Need to cancel the update to a bound form if edits fail (Access 2010) "Phil" <phil@stantonfamily.co.uk> - 2014-03-24 23:00 +0000
          Re: Need to cancel the update to a bound form if edits fail (Access 2010) Ulrich Möller <knobbi38@usenet.arcornews.de> - 2014-03-25 04:31 +0100
            Re: Need to cancel the update to a bound form if edits fail (Access 2010) "Phil" <phil@stantonfamily.co.uk> - 2014-03-25 09:42 +0000
            Re: Need to cancel the update to a bound form if edits fail (Access 2010) PW <emailaddyinsig@ifIremember.com> - 2014-04-03 21:21 -0600
          Re: Need to cancel the update to a bound form if edits fail (Access 2010) "Access Developer" <accdevel@gmail.com> - 2014-03-25 11:50 -0500
            Re: Need to cancel the update to a bound form if edits fail (Access 2010) Ulrich Möller <knobbi38@usenet.arcornews.de> - 2014-03-25 20:23 +0100
              Re: Need to cancel the update to a bound form if edits fail (Access 2010) "Access Developer" <accdevel@gmail.com> - 2014-03-26 14:46 -0500
            Re: Need to cancel the update to a bound form if edits fail (Access 2010) "Phil" <phil@stantonfamily.co.uk> - 2014-03-26 20:12 +0000
    Re: Need to cancel the update to a bound form if edits fail (Access 2010) PW <emailaddyinsig@ifIremember.com> - 2014-03-24 10:57 -0600
      Re: Need to cancel the update to a bound form if edits fail (Access 2010) Patrick Finucane <patrickfinucanetx@gmail.com> - 2014-03-24 10:21 -0700

csiph-web