Calculation using a value from a form and a sub-form.

sparkes84

Registered User.
Local time
Today, 19:03
Joined
Apr 2, 2009
Messages
16
Hi everyone. I have a calculation that requires me to use a field from a sub-form.

The calculation needs to sit in the form called, "frmCSP_PenCLRN_Specific_1". It needs to calculate how many days it took to start the clock after the trust has been advised ie. Dateclockstarted - Datetrustadvised.

The field called 'Date_trust_advised' sits within the main form where the calculation is to take place.

the field called 'Dateclockstarted' sits within the subform of the main form.
The subform is called 'CSP_PenCLRN_Specific_1_sub_form'

I have tried the following but it comes up with a Name# error. All help gratefully received!

Forms!FrmCSP_PenCLRN_Specific_1!CSP_PenCLRN_Specific_1_sub_form.Form![dateclockstarted]-[date_trust_advised]


Thanks,
Sally
 
Is the form and subform built on one query? If so it would be much easier to put the calculation in the query.... paths sometimes get tricky... I like to use the "Expression builder" let it build the path...then copy and paste it. Also, look for a missing "=" sign in the control source of the calculated textbox.

Edit......
Something like this?
 

Attachments

Last edited:
this isnt correct. the point about a subform is it implies there are potentially multiple subform records (or else there is no point having a subform) - so which row are you using from the subform, to undetrake your calculation?

you need to re-consider your data-analysis

Either that, or what you are describing as a subform isnt REALLY a subform.
 

Users who are viewing this thread

Back
Top Bottom