How To Compute "Residual" On Form? 
November 13th, 2005, 10:04 AM
| | | How To Compute "Residual" On Form?
"Residual" is the diff between returns of two funds.
I've got a form.
The form will have two and only two records on it: one for Fund#1 and
the other for Fund#2. Each record contains FundName and FundReturn.
At the bottom of the form, I need to show the diff between Fund#1's
return and Fund#2's return.
With a report, no problem: just define a couple invisible fields with
..RunningSum=Overall, populate them with IIF statements depending on
Fund#, and then compute a diff in ReportFooter.
But there's no RunningSum on a form.
Suggestions? | 
November 13th, 2005, 10:04 AM
| | | Re: How To Compute "Residual" On Form?
how are they displayed? in text boxes? you could do it in vba | 
November 13th, 2005, 10:04 AM
| | | Re: How To Compute "Residual" On Form?
Text boxes.
What event(s) would I use? | 
November 13th, 2005, 10:04 AM
| | | Re: How To Compute "Residual" On Form?
It sounds too simple to me, so I might be missing something, but
couldnt you just have
label = me.txtfield1.value - me.txtfield2.value in vba code? | 
November 13th, 2005, 10:04 AM
| | | Re: How To Compute "Residual" On Form?
> label = me.txtfield1.value - me.txtfield2.value in vba code?
Doesn't work. Refers to values in current record only. In a
report, this can be gotten around by assigning property
..RunningSum=Overall to txtField1 and txtField2. Then it works.
Doesn't work on a Form bc there's no .RunningSum property.
I was trying to stay with the .RecordSet/Continuous form paradigm.
Sounds like it's time to bite the bullet and just set up a grid with a
field for each discreet value (i.e. txtFund1Name, txtFund2name,
txtFund1Value, txtFund2Value...and so-forth) and then just open up a
RecordSet in Form_Open, boogie through the two records, and explicitly
populate each field in the grid. | 
November 13th, 2005, 10:04 AM
| | | Re: How To Compute "Residual" On Form?
Sorry I couldn't be of more help :( | 
November 13th, 2005, 10:04 AM
| | | Re: How To Compute "Residual" On Form?
Thanks for the thought though....
Upon reflection, I think the grid of individual fields is the way to go
anyhow. The users want to be able export the contents of the screen
to an MS Excel spreadsheet - and a grid of individual fields will make
that coding more straightforward - i.e. no recordsets/processing loops
needed.... just go right to the Form object and pick off the fields.... | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 220,989 network members.
|