Connecting Tech Pros Worldwide Forums | Help | Site Map

How To Compute "Residual" On Form?

GoogleGroups@FatBelly.com
Guest
 
Posts: n/a
#1: Nov 13 '05
"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?


Beacher
Guest
 
Posts: n/a
#2: Nov 13 '05

re: How To Compute "Residual" On Form?


how are they displayed? in text boxes? you could do it in vba

PeteCresswell
Guest
 
Posts: n/a
#3: Nov 13 '05

re: How To Compute "Residual" On Form?


Text boxes.

What event(s) would I use?

Beacher
Guest
 
Posts: n/a
#4: Nov 13 '05

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?

PeteCresswell
Guest
 
Posts: n/a
#5: Nov 13 '05

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.

Beacher
Guest
 
Posts: n/a
#6: Nov 13 '05

re: How To Compute "Residual" On Form?


Sorry I couldn't be of more help :(

PeteCresswell
Guest
 
Posts: n/a
#7: Nov 13 '05

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....

Closed Thread


Similar Microsoft Access / VBA bytes