If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Sorry for my insistence, but I would like help
Hello!
I would like help to solve next: MainForm - Table1 with Id1... SubForm - Table2 with Id2... where Id1 to many Id2 SubSubForm - Table3 with Id3... where Id2 to many Id3 SubSubForm - Text box on Form Footer where sum Values of the numeric field. Work fine. SubForm - Text box, on Detail section, with resulting from text box of the Form Footer on SubSubForm. Work fine. MainForm - I would like to sum the values, resulting of sum's on the SubForm, only where the Id is the same (On SubForm and MainForm), but I don't know how. I don't know if I will have been explicit... Thanks in advance. an |
#2
|
|||
|
|||
Your last line is "only where the Id is the same (On SubForm and MainForm),
" Going back to the description "MainForm - Table1 with Id1... SubForm - Table2 with Id2... where Id1 to many Id2" Since this is a main form / sub form and you have confirmed the T1.ID1 = T2.ID1 relationship, how would the ID's not be the same? "an" wrote in message ... Hello! I would like help to solve next: MainForm - Table1 with Id1... SubForm - Table2 with Id2... where Id1 to many Id2 SubSubForm - Table3 with Id3... where Id2 to many Id3 SubSubForm - Text box on Form Footer where sum Values of the numeric field. Work fine. SubForm - Text box, on Detail section, with resulting from text box of the Form Footer on SubSubForm. Work fine. MainForm - I would like to sum the values, resulting of sum's on the SubForm, only where the Id is the same (On SubForm and MainForm), but I don't know how. I don't know if I will have been explicit... Thanks in advance. an |
#3
|
|||
|
|||
Thanks for your reply.
Ok. Exactly. The Id's are equals. But why not is possible to sum it? Why return us #Error when we tryed to sum it??? Thanks more one time. ab -----Original Message----- Your last line is "only where the Id is the same (On SubForm and MainForm), " Going back to the description "MainForm - Table1 with Id1... SubForm - Table2 with Id2... where Id1 to many Id2" Since this is a main form / sub form and you have confirmed the T1.ID1 = T2.ID1 relationship, how would the ID's not be the same? "an" wrote in message ... Hello! I would like help to solve next: MainForm - Table1 with Id1... SubForm - Table2 with Id2... where Id1 to many Id2 SubSubForm - Table3 with Id3... where Id2 to many Id3 SubSubForm - Text box on Form Footer where sum Values of the numeric field. Work fine. SubForm - Text box, on Detail section, with resulting from text box of the Form Footer on SubSubForm. Work fine. MainForm - I would like to sum the values, resulting of sum's on the SubForm, only where the Id is the same (On SubForm and MainForm), but I don't know how. I don't know if I will have been explicit... Thanks in advance. an . |
#4
|
|||
|
|||
On Mon, 10 Jan 2005 02:35:14 -0800, "an"
wrote: MainForm - I would like to sum the values, resulting of sum's on the SubForm, only where the Id is the same (On SubForm and MainForm), but I don't know how. Use the View menu option to make the Subform Footer visible. Put a Textbox on the Footer. Set its Control Source property to =Sum([fieldname]) to sum the field named fieldname. John W. Vinson[MVP] |
#5
|
|||
|
|||
Thanks for your reply.
I already to try, similary with SubSubForm to aply the result in SubForm, but in Form return me #Error and I don't why... Thanks more one time. an -----Original Message----- On Mon, 10 Jan 2005 02:35:14 -0800, "an" wrote: MainForm - I would like to sum the values, resulting of sum's on the SubForm, only where the Id is the same (On SubForm and MainForm), but I don't know how. Use the View menu option to make the Subform Footer visible. Put a Textbox on the Footer. Set its Control Source property to =Sum([fieldname]) to sum the field named fieldname. John W. Vinson[MVP] . |
#6
|
|||
|
|||
On Wed, 12 Jan 2005 03:09:14 -0800, "an"
wrote: Thanks for your reply. I already to try, similary with SubSubForm to aply the result in SubForm, but in Form return me #Error and I don't why... Thanks more one time. Please tell us: - What Forms and Subforms you have - the Name property of each Subform control (not the name of the form within that control, but of the Subform "box" itself) - The Name of each textbox in which you're trying to put these sums - The Control Source of each such textbox John W. Vinson[MVP] |
#7
|
|||
|
|||
Many thanks for your help.
- What Forms and Subforms you have: MainForm, SubForm and SubSubForm - the Name property of each Subform control (not the name of the form within that control, but of the Subform "box" itself) MainForm: F_Percursos Record Source: T_Percursos SubForm: SubF_Trocos Record Source: T_Trocos Name: SubControlTrocos Source Object: SubF_Trocos SubSubForm: SubSubF_Projectos Record Source: T_Projectos Name: SubSubControlProjectos Source Object: SubSubF_Projectos - The Name of each textbox in which you're trying to put these sums Text Box in Form Footer of the SubForm (SubF_Trocos) Name: Text58 Control Source: =Sum([TxtCustoTotalEstimTroco]) (Don't work: #Error) Text Box in Detail Section of the SubForm (SubF_Trocos) Name: TxtCustoTotalEstimTroco Control Source: =[SubSubControlProjectos].[Form]![Text36] (Work fine. The Sum's are Ok.) Text Box in Form Footer of the SubSubForm (SubSubF_Projectos) Name: Text36 Control Source: =Sum([CustoEstimProj]) (Work fine. The Sum's are Ok.) Grateful. an .... John W. Vinson[MVP] . |
#8
|
|||
|
|||
On Thu, 13 Jan 2005 03:18:38 -0800, "an"
wrote: Many thanks for your help. - The Name of each textbox in which you're trying to put these sums Text Box in Form Footer of the SubForm (SubF_Trocos) Name: Text58 Control Source: =Sum([TxtCustoTotalEstimTroco]) (Don't work: #Error) That's the problem. You cannot sum a *TEXTBOX* - but you can sum a *FIELD*. If the Control Source of the textbox txtCustoTotalEstimTroco is the field named CustoTotalEstimTroco, use a DSum expression summing all values of CustoEstimProj which meet the criteria of the two subforms' queries. John W. Vinson[MVP] |
#9
|
|||
|
|||
The Control Source of the textbox txtCustoTotalEstimTroco
is the field named CustoTotalEstimTroco, exactly. I understand your correction. But already tried to use DSum expression with WHERE or LIKE condition but I didn't obtained any result (?) Can you help me in this sintaxe, please? So, I would like DSUM (in MainForm *F_Percursos*) all values of CustoEstimProj (in SubSubForm, *SubSubF_Projectos*) WHERE IdPercurso is the same. Thanks in advance. an -----Original Message----- On Thu, 13 Jan 2005 03:18:38 -0800, "an" wrote: Many thanks for your help. - The Name of each textbox in which you're trying to put these sums Text Box in Form Footer of the SubForm (SubF_Trocos) Name: Text58 Control Source: =Sum([TxtCustoTotalEstimTroco]) (Don't work: #Error) That's the problem. You cannot sum a *TEXTBOX* - but you can sum a *FIELD*. If the Control Source of the textbox txtCustoTotalEstimTroco is the field named CustoTotalEstimTroco, use a DSum expression summing all values of CustoEstimProj which meet the criteria of the two subforms' queries. John W. Vinson[MVP] . |
#10
|
|||
|
|||
On Fri, 14 Jan 2005 02:07:32 -0800, "an"
wrote: The Control Source of the textbox txtCustoTotalEstimTroco is the field named CustoTotalEstimTroco, exactly. I understand your correction. But already tried to use DSum expression with WHERE or LIKE condition but I didn't obtained any result (?) Can you help me in this sintaxe, please? So, I would like DSUM (in MainForm *F_Percursos*) all values of CustoEstimProj (in SubSubForm, *SubSubF_Projectos*) WHERE IdPercurso is the same. The DSum function takes three arguments: the (numeric) field to be summed; the name of the table containing that field; and a string containing a SQL WHERE clause selecting which values to sum. Again, data is NOT stored in forms, and data CANNOT be summed from Forms: only from Tables or Queries. So - GUESSING here, since I cannot see your database - something like =DSum("[CustoEstimProj]", "some table name I don't know", "[IDPercurso] = " & [Forms]![F_Percursos]![IDPercurso]) John W. Vinson[MVP] |
Thread Tools | |
Display Modes | |
|
|