Sorry for my insistence, but I would like help

A

an

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
 
J

JohnFol

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?
 
A

an

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
 
J

John Vinson

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]
 
A

an

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-----
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]
.
 
J

John Vinson

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]
 
A

an

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

....
 
J

John Vinson

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]
 
A

an

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-----
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]
.
 
J

John Vinson

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]
 
A

an

Mr JV, Sorry for my delay.

I brought the file at home in my pen but when I tried to
open return "The Microsoft Jet database engine cannot
open... It is already opened exclusively by another
user..." (?).
Here is 02H10 and only next Monday, eventually "tomorrow"
Saturday, I will be able to test but I promise to inform
you about of the result.

Thanks for your solution. It is very important for my job!
Have you a good weekend.

an
-----Original Message-----
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]

.
 
A

an

Hello!

Recouped today the file and placed its formula in the
Textbox, it returns the next message:

"The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an invalid
character or comma, or..."

Sorry but I don't know why. (?)
Thanks one more time.
an
-----Original Message-----
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]

.
 
D

Douglas J. Steele

Please copy exactly what you're using into your response.

Otherwise, we'd only be guessing.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



an said:
Hello!

Recouped today the file and placed its formula in the
Textbox, it returns the next message:

"The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an invalid
character or comma, or..."

Sorry but I don't know why. (?)
Thanks one more time.
an
-----Original Message-----
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]

.
 
A

an

Thank you for your reply.
I used in Textbox:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = "
& [Forms]![F_Percursos]![IDPercurso])

Many thanks
an
-----Original Message-----
Please copy exactly what you're using into your response.

Otherwise, we'd only be guessing.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Hello!

Recouped today the file and placed its formula in the
Textbox, it returns the next message:

"The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an invalid
character or comma, or..."

Sorry but I don't know why. (?)
Thanks one more time.
an
-----Original Message-----
On Fri, 14 Jan 2005 02:07:32 -0800, "an"

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]

.


.
 
D

Douglas J. Steele

Assuming that's all typed on one line, it looks syntactically correct.

When do you get the error: when you enter the string or when the form is
open? What data type is IDPercurso? What you have is correct if it's
numeric. If it's text, you need to add quotes:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = " & Chr$(34) &
[Forms]![F_Percursos]![IDPercurso] & Chr$(34))

Finally, is form F_Percursos open when the error occurs? (It must be)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



an said:
Thank you for your reply.
I used in Textbox:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = "
& [Forms]![F_Percursos]![IDPercurso])

Many thanks
an
-----Original Message-----
Please copy exactly what you're using into your response.

Otherwise, we'd only be guessing.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Hello!

Recouped today the file and placed its formula in the
Textbox, it returns the next message:

"The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an invalid
character or comma, or..."

Sorry but I don't know why. (?)
Thanks one more time.
an

-----Original Message-----
On Fri, 14 Jan 2005 02:07:32 -0800, "an"

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]

.


.
 
A

an

Ok.

- All typed on one line;
- The error occurs when try the ENTER after to write the
string in Textbox;
- IDPercurso is Autonumber on T_Percursos, and Number in
T_Trocos (One to many). It isn't text;
- The relathionships work fine;
- The F_Percursos don't open because not even accepted the
ENTER, (return error message) and not save;

Thanks.
an
-----Original Message-----
Assuming that's all typed on one line, it looks syntactically correct.

When do you get the error: when you enter the string or when the form is
open? What data type is IDPercurso? What you have is correct if it's
numeric. If it's text, you need to add quotes:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = " & Chr$(34) &
[Forms]![F_Percursos]![IDPercurso] & Chr$(34))

Finally, is form F_Percursos open when the error occurs? (It must be)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Thank you for your reply.
I used in Textbox:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = "
& [Forms]![F_Percursos]![IDPercurso])

Many thanks
an
-----Original Message-----
Please copy exactly what you're using into your response.

Otherwise, we'd only be guessing.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Hello!

Recouped today the file and placed its formula in the
Textbox, it returns the next message:

"The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an invalid
character or comma, or..."

Sorry but I don't know why. (?)
Thanks one more time.
an

-----Original Message-----
On Fri, 14 Jan 2005 02:07:32 -0800, "an"

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]

.



.


.
 
D

Douglas J. Steele

What are your regional settings? For other functions, such as InStr and
Format, do you use , or ; as the separator?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



an said:
Ok.

- All typed on one line;
- The error occurs when try the ENTER after to write the
string in Textbox;
- IDPercurso is Autonumber on T_Percursos, and Number in
T_Trocos (One to many). It isn't text;
- The relathionships work fine;
- The F_Percursos don't open because not even accepted the
ENTER, (return error message) and not save;

Thanks.
an
-----Original Message-----
Assuming that's all typed on one line, it looks syntactically correct.

When do you get the error: when you enter the string or when the form is
open? What data type is IDPercurso? What you have is correct if it's
numeric. If it's text, you need to add quotes:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = " & Chr$(34) &
[Forms]![F_Percursos]![IDPercurso] & Chr$(34))

Finally, is form F_Percursos open when the error occurs? (It must be)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Thank you for your reply.
I used in Textbox:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = "
& [Forms]![F_Percursos]![IDPercurso])

Many thanks
an

-----Original Message-----
Please copy exactly what you're using into your response.

Otherwise, we'd only be guessing.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



message
Hello!

Recouped today the file and placed its formula in the
Textbox, it returns the next message:

"The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an
invalid
character or comma, or..."

Sorry but I don't know why. (?)
Thanks one more time.
an

-----Original Message-----
On Fri, 14 Jan 2005 02:07:32 -0800, "an"

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]

.



.


.
 
A

an

Oops!

My Regional Settings is Portuguese Standard. Effectively I
use ; as separating.

However, after changed to ; it continues to return # Error
(?)

an

-----Original Message-----
What are your regional settings? For other functions, such as InStr and
Format, do you use , or ; as the separator?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Ok.

- All typed on one line;
- The error occurs when try the ENTER after to write the
string in Textbox;
- IDPercurso is Autonumber on T_Percursos, and Number in
T_Trocos (One to many). It isn't text;
- The relathionships work fine;
- The F_Percursos don't open because not even accepted the
ENTER, (return error message) and not save;

Thanks.
an
-----Original Message-----
Assuming that's all typed on one line, it looks syntactically correct.

When do you get the error: when you enter the string or when the form is
open? What data type is IDPercurso? What you have is correct if it's
numeric. If it's text, you need to add quotes:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = " & Chr$(34) &
[Forms]![F_Percursos]![IDPercurso] & Chr$(34))

Finally, is form F_Percursos open when the error occurs? (It must be)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Thank you for your reply.
I used in Textbox:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = "
& [Forms]![F_Percursos]![IDPercurso])

Many thanks
an

-----Original Message-----
Please copy exactly what you're using into your response.

Otherwise, we'd only be guessing.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



message
Hello!

Recouped today the file and placed its formula in the
Textbox, it returns the next message:

"The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an
invalid
character or comma, or..."

Sorry but I don't know why. (?)
Thanks one more time.
an

-----Original Message-----
On Fri, 14 Jan 2005 02:07:32 -0800, "an"

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]

.



.



.


.
 
A

an

Sorry. I forgot myself to inform that, gives error when it
opens the Form, but already accepted the entrance of the
formula.

an
-----Original Message-----
What are your regional settings? For other functions, such as InStr and
Format, do you use , or ; as the separator?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Ok.

- All typed on one line;
- The error occurs when try the ENTER after to write the
string in Textbox;
- IDPercurso is Autonumber on T_Percursos, and Number in
T_Trocos (One to many). It isn't text;
- The relathionships work fine;
- The F_Percursos don't open because not even accepted the
ENTER, (return error message) and not save;

Thanks.
an
-----Original Message-----
Assuming that's all typed on one line, it looks syntactically correct.

When do you get the error: when you enter the string or when the form is
open? What data type is IDPercurso? What you have is correct if it's
numeric. If it's text, you need to add quotes:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = " & Chr$(34) &
[Forms]![F_Percursos]![IDPercurso] & Chr$(34))

Finally, is form F_Percursos open when the error occurs? (It must be)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Thank you for your reply.
I used in Textbox:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = "
& [Forms]![F_Percursos]![IDPercurso])

Many thanks
an

-----Original Message-----
Please copy exactly what you're using into your response.

Otherwise, we'd only be guessing.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



message
Hello!

Recouped today the file and placed its formula in the
Textbox, it returns the next message:

"The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an
invalid
character or comma, or..."

Sorry but I don't know why. (?)
Thanks one more time.
an

-----Original Message-----
On Fri, 14 Jan 2005 02:07:32 -0800, "an"

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]

.



.



.


.
 
A

an

Problem - finally - decided!

1 - For my regional settings, the separator is <;>
2 - The cited table was changed.

One more time, much, very obliged for the aid.

Have you a good Sunday!
an

-----Original Message-----
What are your regional settings? For other functions, such as InStr and
Format, do you use , or ; as the separator?

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Ok.

- All typed on one line;
- The error occurs when try the ENTER after to write the
string in Textbox;
- IDPercurso is Autonumber on T_Percursos, and Number in
T_Trocos (One to many). It isn't text;
- The relathionships work fine;
- The F_Percursos don't open because not even accepted the
ENTER, (return error message) and not save;

Thanks.
an
-----Original Message-----
Assuming that's all typed on one line, it looks syntactically correct.

When do you get the error: when you enter the string or when the form is
open? What data type is IDPercurso? What you have is correct if it's
numeric. If it's text, you need to add quotes:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = " & Chr$(34) &
[Forms]![F_Percursos]![IDPercurso] & Chr$(34))

Finally, is form F_Percursos open when the error occurs? (It must be)

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Thank you for your reply.
I used in Textbox:

=DSum("[CustoEstimProj]", "T_Percursos", "[IDPercurso] = "
& [Forms]![F_Percursos]![IDPercurso])

Many thanks
an

-----Original Message-----
Please copy exactly what you're using into your response.

Otherwise, we'd only be guessing.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



message
Hello!

Recouped today the file and placed its formula in the
Textbox, it returns the next message:

"The expression you entered contains invalid syntax.
You omitted an operand or operator, you entered an
invalid
character or comma, or..."

Sorry but I don't know why. (?)
Thanks one more time.
an

-----Original Message-----
On Fri, 14 Jan 2005 02:07:32 -0800, "an"

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]

.



.



.


.
 

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