Displaying a calculated field from a subform on the main form

G

Guest

Hi - I have an orders main form with an order details subform. On the order
details subform, I've created a text box in the form footer to calculate the
subtotal of each order by multiplying the quantity by the item price. On the
main form, I created a field that refers to this calculated field on the
subform. The problem is the field on the main form keeps showing "#Name?".
I have another set of linked forms/subforms that work perfectly with this
setup (different fields, but the same idea) and I've matched the properties
exactly. I've also checked the Northwind database and set my form up exactly
as theirs is shown. I'm at a loss at this point as to why I can't get the
field to work. Any suggestions on where to look next would be much
appreciated. Here are my fields:

On the Order Detail Subform: =Sum([Quantity]*[Item Price])
On the Form: =[Order Detail Subform].[Form]![Subtotal]

If more information is required, just let me know. Thanks!
 
G

Guest

Are you sure that Subtotal returns a value, mybe one of the records
[Quantity] or [Item Price] has a null value so the sum field return a name.

While the form is running open the immidiate window (ctrl+G) and type
?Forms![MainFormName]![Order Detail Subform].Form![Subtotal]

And see if it returns any value, if you have null values in the details you
might want to add the NZ function to it.
 

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