Solved

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

Posted on 2013-10-22
4
393 Views
Last Modified: 2013-10-26
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
Comment
Question by:SteveL13
  • 2
4 Comments
 
LVL 57
ID: 39592234
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
 

Author Comment

by:SteveL13
ID: 39592258
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
 
LVL 57
ID: 39592407
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
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 39592427
Also, make sure you are using the AfterUpdate event of the *Form*,
(...not the after update event of the control....)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now