• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 470
  • Last Modified:

How make query run ONLY if data on a form has been changed

What event do I use to run a query ONLY of data on a form has changed?  I thought it would be afterupdate but even if I haven't changed anything on the current form's data the query seems to want to run.
0
SteveL13
Asked:
SteveL13
  • 2
1 Solution
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
AfterUpdate is it.   It only fires if the record was updated.

Note that if you change a control, then change it back, it's still considered a change.

Jim.
0
 
SteveL13Author Commented:
Hmmm.  I have it in the afterupdate event of the form but the query is trying to run even if I haven't changed any data in the current record.
0
 
Jim Dettman (Microsoft MVP/ EE MVE)President / OwnerCommented:
Something your doing must be making the record dirty.

Turn the record selectors on and then watch when it changes to a pencil.  That's the point the record is considered changed.

Another check:

1. Call the record up.
2. Hit esc twice (undo control and undo form).
3. Now close the form.  You should find that your query does not run.

Jim.
0
 
Jeffrey CoachmanMIS LiasonCommented:
Also, make sure you are using the AfterUpdate event of the *Form*,
(...not the after update event of the control....)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now