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

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
 
J

Jeff Boyce

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
 
M

Maraci

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
 
J

Jeff Boyce

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
 
M

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
 
J

Jeff Boyce

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
 
I

indeedpanda

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]
 

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