Continuous Form code for current record

Q

Question Boy

Hello,

I have a continuous form where I have added a button to perform a
calculation. i want it so that when the button is clicked it update the
textbox on the form with this calculated value. the problem that I have is
that when I click the button it updates every records value with the one
calculated from the active record. So if I have 3 records on the continuous
form all three get the calculated value from the active records. How can I
only update the current record with the calculated value?

Thank you,

QB
 
B

BruceM

Perhaps you could base the form on a query, and have the calculation in the
query. Then you would just need to bind a text box to the calculated field.
What is the calculation?
 
Q

Question Boy

Originally, I had placed it in the query, but sadly it slowed down the form
too much. So my approach was to remove it, so the form open instantaneously
with 90% of the data and then the user can click a button when the need this
calculation for the current record.

It's the best compramise I could come up with for the need.

QB
 
B

BruceM

Is there some reason you don't want to let anybody here know what
calculation you are using?
 
L

Linq Adams via AccessMonster.com

I'd also be interested in seeing a calculation that slows down your form's
opening to such an extent! How many records are we talking about here?

Your only options in a continuous form are, as suggested, to do the
calculations in the query or to store the calculation results in a bound
field. And before someone chimes in, as they always do, yes, storing
calculated results in a table is frowned on by many, but there are instances
where it's allowable! They're even circumstances where it's absolutely
necessary! You just have to weigh pros and cons and decide if the trade-off
is worth it to you; speed versus storage space.
 
Q

Question Boy

No, I was using the example of a calculation for simplicity,but in fact I am
using Duane Hookom's (I hope I spelt that right) Concatenate Function. In
this particular case, I am using it twice (or was) for two fields. I love
the function, but it slows things down tremendously, but gives me the desired
result!

QB
 
B

BruceM

I think one of the problems with storing a calculated value is that it is
necessary to perform the calculation whenever there is a change to one of
the fields or data on which the calculated value is based. The best way to
be sure of that may be to check the calculation each time the recordset is
opened. I think this would be particularly necessary if a linked table or
other outside data source contains an input to the calculated value. If the
result needs to be checked each time, there is no point to storing the value
at all. Historical data, such as a person's age at the time of an incident
in their life, will not change provided the data were input correctly in the
first place, so there is a better argument for storing such a calculation
result.
I realize there are techniques that involve storing summary values when
analyzing large chunks of information, and other reasons for storing a
calculation, but absent details of the problem I would be reluctant to make
the suggestion, particularly since the user mentions performing the
calculation on the fly anyhow.
 
B

BruceM

Duane Hookum's Concatenate function is for combining information from
subform records into a string. On what recordset are you attempting to use
it in a continuous form?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top