I'm trying to create a calculation that includes 1 field from my main form.
The calculation will be put on the subform. This is what I have for a formula
in the control source field:
=(Forms!PSHourlyRate!HourlyRate1-[TotalCost])/[TotalCost]
It doesn't seem to be working. Am I missing something with the way this
formula is set up?
UE Marketing - 22 Jan 2008 11:44 GMT
> I'm trying to create a calculation that includes 1 field from my main
> form.
[quoted text clipped - 6 lines]
> It doesn't seem to be working. Am I missing something with the way this
> formula is set up?
NetworkTrade - 23 Jan 2008 00:20 GMT
It would probably be wise to first make sure you can get the value of the
mainform into the subform before proceeding with a calculation;
the syntax I would try is: Forms!MainFormName.ControlName
the shortcut often works: Me.Parent.ControlName

Signature
NTC
> I'm trying to create a calculation that includes 1 field from my main form.
> The calculation will be put on the subform. This is what I have for a formula
[quoted text clipped - 4 lines]
> It doesn't seem to be working. Am I missing something with the way this
> formula is set up?
Wayne-I-M - 23 Jan 2008 00:56 GMT
Hi
It depends where your calculted box is
If it's on the main from
=Nz(SubformName.Form!ControlName,0)+Nz([MainFormControl],0)
If it's on the subform
=Nz([Forms]![MainFormName]![MainFormControl],0)+Nz([SubformControl],0)

Signature
Wayne
Manchester, England.
> I'm trying to create a calculation that includes 1 field from my main form.
> The calculation will be put on the subform. This is what I have for a formula
[quoted text clipped - 4 lines]
> It doesn't seem to be working. Am I missing something with the way this
> formula is set up?
Wayne-I-M - 23 Jan 2008 00:58 GMT
Hi
It depends where your calculated box is as you need to refer to the form and
then the control like this
If it's on the main from
=Nz(SubformName.Form!ControlName,0)+Nz([MainFormControl],0)
If it's on the subform
=Nz([Forms]![MainFormName]![MainFormControl],0)+Nz([SubformControl],0)
In your case
=(Forms!PSHourlyRate!HourlyRate1-[TotalCost])/[TotalCost]
I’m not sure how you are getting [TotalCost], is this the name of a control
? or is it something else
Also are you sure that all the controls have a value (ie. You are not using
Nz)

Signature
Wayne
Manchester, England.
> I'm trying to create a calculation that includes 1 field from my main form.
> The calculation will be put on the subform. This is what I have for a formula
[quoted text clipped - 4 lines]
> It doesn't seem to be working. Am I missing something with the way this
> formula is set up?
Dale Fye - 23 Jan 2008 01:52 GMT
Is this the control source for a control on the subform? If so, where is
this control on the subform (footer)?
Assuming that [HourlyRate1] is field in the main forms record source, try:
= (me.parent.HourlyRate1 - [TotalCost])/[TotalCost]
HTH
Dale

Signature
Don''t forget to rate the post if it was helpful!
email address is invalid
Please reply to newsgroup only.
> I'm trying to create a calculation that includes 1 field from my main form.
> The calculation will be put on the subform. This is what I have for a formula
[quoted text clipped - 4 lines]
> It doesn't seem to be working. Am I missing something with the way this
> formula is set up?
Dale Fye - 23 Jan 2008 01:59 GMT
Secret,
Is this control on the subform? Is this control in the subforms footer?
Is HourlyRate1 a field in your main forms record source?
If so, try:
= (me.parent.HourlyRate1 - [TotalCost])/[TotalCost]
HTH
Dale

Signature
Don''t forget to rate the post if it was helpful!
email address is invalid
Please reply to newsgroup only.
> I'm trying to create a calculation that includes 1 field from my main form.
> The calculation will be put on the subform. This is what I have for a formula
[quoted text clipped - 4 lines]
> It doesn't seem to be working. Am I missing something with the way this
> formula is set up?