Solved

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

Posted on 2013-10-22
4
426 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

756 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