- Total Members: 219,987
- Threads: 525,374
- Posts: 976,954
-
February 12th, 2013, 03:15 PM
#1
Calculate Value Using Previous Record's Calculated Form Data
Hi Everyone,
I'm looking for some help with referring to a previous record in a form and performing calculations with that value.
In my form, a user can adjust the "Percent" cell percentage to what they like. The neighboring fields, "Contributions" and "Interest" automatically recalculate new values based on the user input for the "Percent" field.
The "Fund Balance" value is the SUM of the previous record's "Fund Balance" (aka a running sum), along with addition of the previous "Contributions" and the previous "Interest" fields.
How can I get the "Fund Balance" field to automatically recalculate using data from the previous record's form calculation???
I am a noob so any help is appreciated, thanks.
-
February 12th, 2013, 06:52 PM
#2
Is this a sum of all of the previous records, or only those viewed in this session by the user?
-
February 13th, 2013, 10:42 AM
#3
Thanks for the reply!
Only those viewed in the session by the user.
This is because, of the presented records, the user could change the "Percent Value", which will automatically adjust the "Interest", and thereby needing the "Fund Balance" to be recalculated.
-
February 13th, 2013, 12:05 PM
#4
Create an unbound text box on your form. Set the visible property to false. Set the default value to zero. This text box will store the information from the previous record that you want to recall. When you complete one record and move onto the next you simply add your desired value to the value already saved in the text box. Example
First record: Saved Value = 0 Value used for running sum = 150
when you go to the next record, use code to add the running sum value to the saved value
Second record: Saved Value = 150 Value used for running sum = 75
run code
Third record: Saved Value = 225
and so on....
Since this is only a temporary value for while the user is logged in during this session, you could also use a global variable to save the value as well.
-
February 13th, 2013, 12:48 PM
#5
I think I see the solution coming together, could you elaborate on the global variable a bit?
Thanks
-
February 15th, 2013, 06:07 AM
#6
I actually don't use global variable much. You'd be better off just doing a quick google search, a ton on info will come up.
Similar Threads
-
By heinm51 in forum Microsoft Access Help
Replies: 3
Last Post: November 12th, 2010, 04:49 PM
-
By markos in forum Microsoft Access Help
Replies: 1
Last Post: November 11th, 2008, 08:55 AM
-
By thesizz in forum Microsoft Access Help
Replies: 1
Last Post: January 28th, 2007, 09:16 PM
-
By Matt71 in forum Microsoft Access Help
Replies: 1
Last Post: September 15th, 2004, 11:12 AM
-
By skwilliams in forum Microsoft Access Help
Replies: 0
Last Post: August 27th, 2004, 02:03 PM