Passing a calculated value between subforms

D

Dennis Grant

Access xp - I have a form with two sub-forms.

on the first sub-form, continuous form, (Question & Answers(numbers) Form) i
have a text box in the form footer which totals a field (control source
=sum([Answers])) this total will change as the form is completed.

I need this value to be written into a field on the second sub-form
(Results). At the moment it keeps writing the previous total so the value
in the second sub-form is always one total behind.

any suggestions!

Thanks
 
B

Bill

Are there any events triggered when this calculated field is updated??

If not you may be stuck with your timer solution or a manual Refresh button
maybe an option.

Good Luck

Bill

Dennis Grant said:
Thank Bill

Tried it already. The calculated field is calculated automattically by
Access. The only successful method i have found so far is using the timer
on the form and the condition if value 1 <> value 2 then change value 2
This is a waste of processing time as the timer is continually working
(slowing down the system)

Bill said:
Try a form refresh in the field Afterupdate or changed event.
Bill

Dennis Grant said:
Access xp - I have a form with two sub-forms.

on the first sub-form, continuous form, (Question & Answers(numbers)
Form)
i
have a text box in the form footer which totals a field (control source
=sum([Answers])) this total will change as the form is completed.

I need this value to be written into a field on the second sub-form
(Results). At the moment it keeps writing the previous total so the value
in the second sub-form is always one total behind.

any suggestions!

Thanks
 
D

Dennis Grant

Unfortunately not, if you place a calculated field in the form footer it is
automatically updated by access once the record is saved/updated no
code/event exists to capture this.

i have tried utilising the form_afterupdate to force a recalculation and
then pass the value, but whilst its recalculating the old value is written!

ive used access for many years, and this is the longest ive ever spent on a
problem! especially one that seems so simple!!!

Thanks for your help

D.
Bill said:
Are there any events triggered when this calculated field is updated??

If not you may be stuck with your timer solution or a manual Refresh button
maybe an option.

Good Luck

Bill

Dennis Grant said:
Thank Bill

Tried it already. The calculated field is calculated automattically by
Access. The only successful method i have found so far is using the timer
on the form and the condition if value 1 <> value 2 then change value 2
This is a waste of processing time as the timer is continually working
(slowing down the system)

Bill said:
Try a form refresh in the field Afterupdate or changed event.
Bill


Access xp - I have a form with two sub-forms.

on the first sub-form, continuous form, (Question & Answers(numbers) Form)
i
have a text box in the form footer which totals a field (control source
=sum([Answers])) this total will change as the form is completed.

I need this value to be written into a field on the second sub-form
(Results). At the moment it keeps writing the previous total so the value
in the second sub-form is always one total behind.

any suggestions!

Thanks
 
D

Dennis Grant

FOUND A SOLUTION!!!!

Save record after every update
Pass the value to a textbox on the parent form.
recalc parent form
pass value to second form via the parent form

long winded but works!

Dennis Grant said:
Unfortunately not, if you place a calculated field in the form footer it is
automatically updated by access once the record is saved/updated no
code/event exists to capture this.

i have tried utilising the form_afterupdate to force a recalculation and
then pass the value, but whilst its recalculating the old value is written!

ive used access for many years, and this is the longest ive ever spent on a
problem! especially one that seems so simple!!!

Thanks for your help

D.
Bill said:
Are there any events triggered when this calculated field is updated??

If not you may be stuck with your timer solution or a manual Refresh button
maybe an option.

Good Luck

Bill

Dennis Grant said:
Thank Bill

Tried it already. The calculated field is calculated automattically by
Access. The only successful method i have found so far is using the timer
on the form and the condition if value 1 <> value 2 then change value 2
This is a waste of processing time as the timer is continually working
(slowing down the system)

Try a form refresh in the field Afterupdate or changed event.
Bill


Access xp - I have a form with two sub-forms.

on the first sub-form, continuous form, (Question & Answers(numbers)
Form)
i
have a text box in the form footer which totals a field (control source
=sum([Answers])) this total will change as the form is completed.

I need this value to be written into a field on the second sub-form
(Results). At the moment it keeps writing the previous total so the
value
in the second sub-form is always one total behind.

any suggestions!

Thanks
 

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