problem with dsum in subform

redblaze

Registered User.
Local time
Today, 15:19
Joined
Jan 12, 2002
Messages
54
i seem to be having problems with a dsum which is in a subform.

the layout of my database is as follows: all forms are subforms on the switchboard. each subform is located within a tab. in the order form i have a dsum formula....

=DSum("[Total]","[qOrderSubform]","[txtReferenceID]"=Forms!fSwitchboard!subformOrder.Form!sfOrder.Form!txtTotal)

"qordersubform" is the query used in the subform in the order form. the subform on the switchboard is called subformorder and the subform on the order form is called sforder. if this has not confused anybody are there any ideas you have to make this work.?
 
First make this correction to see if this will solve it.

Change the position of the end quote in the where statement:

Not: "[txtReferenceID]"=Forms!fSwitchboard!SubformOrder.Form!sfOrder.Form!txtTotal

This: "[txtReferenceID]=" & Forms!fSwitchboard!SubformOrder.Form!sfOrder.Form!txtTotal

That will be correct if the criteria is an integer.
 
doesnt seem to work.....?

the box still appears blank. when i go to a new record, the box then has the msg '#Error'. are there any ideas on how i can solve this problem
 
by the way... the box i am trying to DSum is a currency field
 
Explain what is held in txtReferenceID and what is held in txtTotal...
 
in txtReferenceID the individual id for each order is held (invoice number).

in txtTotal this is a text box on the subform of the order form, which holds the Total Cost of each order line.
 

Users who are viewing this thread

Back
Top Bottom