Results 1 to 4 of 4
  1. #1
    RJosephNewton is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    6

    Determining cause of Update event


    Hi Folks,

    Can anybody point me to any event that riggers prior to BeforeUpdate when a subform is entered from its parent? I have a form that needs to signal its user when they are finished editing information on a single record, and offer the option of adding the current intake event to a different history table.

    This should only trigger once per client, when the form is closed, or when a new client is chosen for viewing, and only if the data has been edited. The BeforeUpdate event would be perfect, except that Access is hyperactive with its updates, and does it whenever my users click into either of two subforms.

    Is there any event that would fire that would trigger prior to the BeforeUpdate event that would indicate when the cause of the update was just moving into one of the subforms?

    I've tried capturing the mouse position with an API call, but his lead to a lot more calls to get the window position in related terms, then more calls to the GetScrollPos functin to acount for the adjustments due to scrolling. Bandage upon bandage! It sees like there should be a more direct way.

    Any suggestions? This is driving me buggy.

    Joseph

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    I suppose you are being humorous to write "Access is hyperactive with its updates" as of course code is code and there is no personality involved.....

    code runs linear - so do anything 'before' - you put the code before....

  3. #3
    RJosephNewton is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2010
    Posts
    6
    Thanks,

    I'll get to the quip in a bit. The issue is where before is. I am trying to capture user-initiated events, and the question is where to find the "before" in the code. What I am looking for is either an event that triggers based on the user moving into the subform, prior to the BeforeUpdate event, or to find a way from within BeforeUpdate to ascertain what event actually triggered the update. If the event is only the user working within a contained subform, the message asking the user to commit their work shoould be suppressed, since it should only occur once each time a client screening sheet is edited for a given client, and only when the person is done for certain with the record.


    As to anthropomorphic language: Well actually, behavior patterns do not rely on human motivations. The pattern displayed by Access is hyperactive. There is no logical reason to auto-commit just because the user has moved to essentially a different field within the form, so this interim commits are excessive, in my view. If therre is a point to auto-commit at all it should still only happen when the user closes the form or moves to a different record *within that forms dataset".

    Joseph

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Because a form and subform are normally be bound to different tables, this really isn't accurate: "the user has moved to essentially a different field within the form". The user is moving to a different table, thus the data for the form/subform being departed is committed. When moving from form to subform, the form's update events will fire if data has changed, and the subform's update events will fire when leaving the subform if data has changed.

    I understand what you're saying, but while you may think of it all as one client's data, each form is bound to a different set of data (related yes, but different), thus must update when you leave the form.

    Other than going to unbound forms, I don't know of any way around the main form updating when you go to the subform.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Syntax For After Update Event
    By MuskokaMad in forum Forms
    Replies: 14
    Last Post: 03-12-2010, 01:48 PM
  2. Form does not update after event
    By pedro in forum Forms
    Replies: 10
    Last Post: 12-23-2009, 07:54 AM
  3. Replies: 21
    Last Post: 06-03-2009, 05:54 PM
  4. Determining Winners/Losers
    By pfeff in forum Queries
    Replies: 0
    Last Post: 02-21-2008, 03:46 PM
  5. Befor update event
    By wasim_sono in forum Forms
    Replies: 1
    Last Post: 03-24-2006, 07:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums