Re: BeforeUpdate or AfterUpdate?

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Dirk Goldgar (dg_at_NOdataSPAMgnostics.com)
Date: 10/18/04


Date: Mon, 18 Oct 2004 15:21:16 -0400


"Gary Schuldt" <garyschuldt@comcast.net> wrote in message
news:O8wqHiTtEHA.2864@TK2MSFTNGP09.phx.gbl
> Thanks, Dirk.
>
> It seems to me, though, that capitalization is an example of
> "automated" validation and could be easily considered a BeforeUpdate
> process.

>From my point of view, it's not validation, since there's no plan to
reject the data entered by the user and keep the focus in the control.

> As I understand the AfterUpdate event, it is raised after the value
> in the control is copied from the Control Buffer to the Record
> Buffer. Wouldn't you want to logically "fix up" a value before it
> was copied rather than after?

I believe you're right about the sequence of events, but it seems to me
that it makes no difference. The value is going to be (a) modified in
the control buffer, (b) copied to the record buffer, and (c) modified by
the code. Although nothing can happen until action (a) is taken, does
it really matter whether the remaining actions proceed (b), (c) or (c),
(b)?

So to me, the only significant difference between the events is whether
my code might choose to keep the focus in the control. That's why I use
the events the way I do.

> I'm trying to become a more "intuitive" Access programmer rather than
> trying to keep a bunch of rules and conventions in my poor ol' head!

That's good. As I said, it doesn't really matter in this case. If you
arrive at a convention that makes sense to *you*, that's to your
benefit.

-- 
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)


Relevant Pages

  • Re: Bill Hobba aka Dirk van der moortel
    ... >> writing under ... But the conjecture that me and Dirk are one in the same is ... > understand physics - which is true up to a point. ... I used to have less control. ...
    (sci.physics.relativity)
  • Re: Strange behavior moving from Access 97 to Access 2000
    ... Thank you Dirk. ... other contexts ie. key strokes being stored in the mystical buffer? ... Thus, that control has the focus, receives ... > tab order. ...
    (microsoft.public.access.formscoding)
  • Re: Strange behavior moving from Access 97 to Access 2000
    ... Thank you Dirk. ... other contexts ie. key strokes being stored in the mystical buffer? ... Thus, that control has the focus, receives ... > tab order. ...
    (microsoft.public.access.forms)
  • Re: Strange behavior moving from Access 97 to Access 2000
    ... Thank you Dirk. ... other contexts ie. key strokes being stored in the mystical buffer? ... Thus, that control has the focus, receives ... > tab order. ...
    (microsoft.public.access.gettingstarted)
  • Re: Tab page visible
    ... Wow Dirk that was quick! ... > have a function that you call from the AfterUpdate event of every data ... > control on the page, checking whether *all* have now been filled out. ... > Dirk Goldgar, MS Access MVP ...
    (microsoft.public.access.formscoding)