Add a Calculated control that displays the total sum of two fields

  • Thread starter Thread starter Maraci
  • Start date Start date
M

Maraci

Hi,

I need to add a calculated control to a form that displays the sum of two
fields. These two fields are in the same table. I have come up with:
[tblContract]![MonthlyLessonCost]+[tblContract]![MonthlyRentalCost]=Total
Monthly Cost
also:
=[tblContract]![MonthlyLessonCost]+[tblContract]![MonthlyRentalCost]/[Sum]
and hundreds of of other options, but none seems to work.

Anybody to help me?
Thanks,

Maraci
 
Maraci

Are the values you wish to add found ONLY in the table, or are they already
displayed on the form?

If you wish to refer to a field in a table, take a look at the Access HELP
on DLookup().

If you wish to refer to a control on a form, use something like:

Forms!YourFormName!YourControlName

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
The Fileds that i want to display the sum area have already been added to the
form.

Maraci

Jeff Boyce said:
Maraci

Are the values you wish to add found ONLY in the table, or are they already
displayed on the form?

If you wish to refer to a field in a table, take a look at the Access HELP
on DLookup().

If you wish to refer to a control on a form, use something like:

Forms!YourFormName!YourControlName

Regards

Jeff Boyce
Microsoft Office/Access MVP

Maraci said:
Hi,

I need to add a calculated control to a form that displays the sum of two
fields. These two fields are in the same table. I have come up with:
[tblContract]![MonthlyLessonCost]+[tblContract]![MonthlyRentalCost]=Total
Monthly Cost
also:
=[tblContract]![MonthlyLessonCost]+[tblContract]![MonthlyRentalCost]/[Sum]
and hundreds of of other options, but none seems to work.

Anybody to help me?
Thanks,

Maraci
 
Review my response. It contains the syntax you'd need to adapt (your
control & form names).

Regards

Jeff Boyce
Microsoft Office/Access MVP

Maraci said:
The Fileds that i want to display the sum area have already been added to
the
form.

Maraci

Jeff Boyce said:
Maraci

Are the values you wish to add found ONLY in the table, or are they
already
displayed on the form?

If you wish to refer to a field in a table, take a look at the Access
HELP
on DLookup().

If you wish to refer to a control on a form, use something like:

Forms!YourFormName!YourControlName

Regards

Jeff Boyce
Microsoft Office/Access MVP

Maraci said:
Hi,

I need to add a calculated control to a form that displays the sum of
two
fields. These two fields are in the same table. I have come up with:
[tblContract]![MonthlyLessonCost]+[tblContract]![MonthlyRentalCost]=Total
Monthly Cost
also:
=[tblContract]![MonthlyLessonCost]+[tblContract]![MonthlyRentalCost]/[Sum]
and hundreds of of other options, but none seems to work.

Anybody to help me?
Thanks,

Maraci
 
Jeff,

You are being very nice, but I don't get it. I tried to enter

=([MonthlyLessonCost]+[Total Monthly Cost] MonthlyRentalCost]
Form!frmContract!), but I'm sure I did something wrong because it didn't
work.

Can you guide me again?

Thanks and regards,

Maraci

Jeff Boyce said:
Review my response. It contains the syntax you'd need to adapt (your
control & form names).

Regards

Jeff Boyce
Microsoft Office/Access MVP

Maraci said:
The Fileds that i want to display the sum area have already been added to
the
form.

Maraci

Jeff Boyce said:
Maraci

Are the values you wish to add found ONLY in the table, or are they
already
displayed on the form?

If you wish to refer to a field in a table, take a look at the Access
HELP
on DLookup().

If you wish to refer to a control on a form, use something like:

Forms!YourFormName!YourControlName

Regards

Jeff Boyce
Microsoft Office/Access MVP

Hi,

I need to add a calculated control to a form that displays the sum of
two
fields. These two fields are in the same table. I have come up with:
[tblContract]![MonthlyLessonCost]+[tblContract]![MonthlyRentalCost]=Total
Monthly Cost
also:
=[tblContract]![MonthlyLessonCost]+[tblContract]![MonthlyRentalCost]/[Sum]
and hundreds of of other options, but none seems to work.

Anybody to help me?
Thanks,

Maraci
 
Open the form in design view.

Click on the "calculated control" and open its property window.

Find the property for Control Source.

Add something like the following (untested):

=Forms!FormName!ControlName

(where you substitute your FormName and your ControlName).

NOTE: if this form already has the controls on it, you could use:

=Me!ControlName

Regards

Jeff Boyce
Microsoft Office/Access MVP

Maraci said:
Jeff,

You are being very nice, but I don't get it. I tried to enter

=([MonthlyLessonCost]+[Total Monthly Cost] MonthlyRentalCost]
Form!frmContract!), but I'm sure I did something wrong because it didn't
work.

Can you guide me again?

Thanks and regards,

Maraci

Jeff Boyce said:
Review my response. It contains the syntax you'd need to adapt (your
control & form names).

Regards

Jeff Boyce
Microsoft Office/Access MVP

Maraci said:
The Fileds that i want to display the sum area have already been added
to
the
form.

Maraci

:

Maraci

Are the values you wish to add found ONLY in the table, or are they
already
displayed on the form?

If you wish to refer to a field in a table, take a look at the Access
HELP
on DLookup().

If you wish to refer to a control on a form, use something like:

Forms!YourFormName!YourControlName

Regards

Jeff Boyce
Microsoft Office/Access MVP

Hi,

I need to add a calculated control to a form that displays the sum
of
two
fields. These two fields are in the same table. I have come up
with:
[tblContract]![MonthlyLessonCost]+[tblContract]![MonthlyRentalCost]=Total
Monthly Cost
also:
=[tblContract]![MonthlyLessonCost]+[tblContract]![MonthlyRentalCost]/[Sum]
and hundreds of of other options, but none seems to work.

Anybody to help me?
Thanks,

Maraci
 
If you're trying to create a calculated control that displays the total of two field located on the same form then you just need an expression. =[Field1]+[Field2]
 
Back
Top