Creating Totals in Forms and Subforms

G

Guest

In Access 2002, I created a form to show the equipment our company has sold.
The first subform shows the price we paid to get the equipment to our
dealership. The second subform shows the rental income for the equipment, if
we rented the equipment prior to the sale. I can get the Total Sales Price
to calculate in the main form. I can also get a total puchase price and
total rental income on the subforms. I now need to calculate the total
profit or loss upon the sale of the equipment. The expression I need is this
Total Sales Price + Rental Income - Purchase Price. I used Expression
Builder to create this calculation, however, it is returning an error
message, "The expression On Load you entered as an event property setting
produced the following error, Type Mismatch." How do I create this
expression in Access?
Thank you,
 
B

Brian Bastl

Don't use the On Load event.

Assuming that the text control for the calculation on your main form is
unbound,

your control source syntax would be:

=[Total Sales Price] + Nz(Forms!MyForm!MySubFormControl1.Form![Rental
Income],0) - Nz(Forms!MyForm!MySubFormControl2.Form![Purchase Price],0)

HTH,
Brian
 

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