Solved

Automatically fire After Update event on all records in form using existing data

Posted on 2013-06-13
6
268 Views
Last Modified: 2013-06-13
Here is my situation.  I have existing data in a field called ITP Date.  I have added additional fields which are calculated based on the data entered in ITP, (but again, the data is already there).  Is there any way to get the new fields to update without rekeying the data into ITP?

Thanks.
0
Comment
Question by:manndo
6 Comments
 
LVL 57
ID: 39244794
You'd want to use an update query against the table.

Jim.
0
 
LVL 10

Expert Comment

by:HuaMinChen
ID: 39244803
Use DB trigger to further update other column upon the change of a specific column (in this case which is ITP date). Read
CREATE TRIGGER
0
 

Author Comment

by:manndo
ID: 39244906
The AFter Update Event is on the form.  Re-entering the data into the table does not fire the After Update event, thus the other fields based on the After Update event are not calculated.  The After Update event placed on the ITP field is this......

Me.[1st Review] = DateAdd("d", 90, Me.ITP)
Me.Redevelopment = DateAdd("d", 365, Me.ITP)

Neither the 1st Review field or the Redevelopment fields are updated after running Update query on the Table.  Thanks again for your help.
0
The New “Normal” in Modern Enterprise Operations

DevOps for the modern enterprise offers many benefits — increased agility, productivity, and more, but digital transformation isn’t easy, especially if you’re not addressing the right issues. Register for the webinar to dive into the “new normal” for enterprise modern ops.

 
LVL 4

Expert Comment

by:BAKADY
ID: 39244972
I have added additional fields which are calculated based on the data entered in ITP, (but again, the data is already there).
what are the default values these fields??? are they NULL???

1. About triggers, you can create them to catch INSERT, UPDATE and DELETE events, but not for ALTER TABLE...
2. About your new fields if thes are NULL you can recalculate then...
3. After that you need to create a trigger to calculate new records, or do this at program level.
4. If you cann't do #3 you have to recalculate your fields before each data request, but only them who are NULL, in this case an index can speed up the process.

regards
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 500 total points
ID: 39244976
<<Neither the 1st Review field or the Redevelopment fields are updated after running Update query on the Table.  Thanks again for your help. >>

 You'll need to refresh the forms recordset after you run the update query.

 I'm assuming you wanted to do this as a one time only.

 In your update query, drag down the 1st Review and Redvelopment fields.

 On the update line under those columns, do:

DateAdd("d", 90, [ITP])

and

DateAdd("d", 365, [ITP])

 Execute the query.  Now check the table; are the fields updated?  

 If so, then either close/open the form or hit F5 to refresh the data.

From this point forward then, you form shoul dbe updating the fields/records with the AfterUpdate event of the ITP control.

Jim.
0
 

Author Closing Comment

by:manndo
ID: 39245073
Thank you Jim.  Your solution is what I was looking for on this one.  It worked great.  I really appreciate it.  Yes.  It was a one-time thing and from now on when data is entered on the form, the After Update event will update the fields.  Thanks again.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Introduction Hopefully the following mnemonic and, ultimately, the acronym it represents is common place to all those reading: Please Excuse My Dear Aunt Sally (PEMDAS). Briefly, though, PEMDAS is used to signify the order of operations (http://en.…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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