Solved Syntax error in DSum

zelarra821

Registered User.
Local time
Today, 19:09
Joined
Jan 14, 2019
Messages
860
Buenas tardes. I'm trying to add a field based on some criteria, and it gives me the error #Name?.

I pass you the database. It is the FGestionDeProyectos form, in the field at the bottom that says Gastos and also in the Ingresos field.

Thanks
 
in the field at the bottom that says Gastos and also in the Ingresos field.
Please write - What are you trying to show in this field?
Your expression:
Code:
=DSum([Gastos];[CGastosEIngresos]; "IdCategoria=2 And IdImporte=" & [IdImporte])
Can't work because there is no "[CGastosEIngresos]" field in the "[Gastos]" query
 
The "#Name" error is because you incorrectly named something. There is no IdImporte in the CCastosEIngresos query so... Access can't find the thing you named.
 
Please write - What are you trying to show in this field?
I want the formula to add the amounts that meet the criteria IdCategoria = 2 and IdImporte the one you choose from the dropdown

There is no IdImporte in the CCastosEIngresos query so... Access can't find the thing you named.
Fixed. I have put all the fields of the query, exactly as I want, and it keeps giving me the same error.

=DSuma([Importe];[CGastosEIngresos];"IdCategoria=2 And IdProyecto=" & [IdProyecto])
 
Did you look at the error message by clicking the yellow triangle on the field? It told you about the circular reference and even what field was causing it:) Rename the field to something else and also fix the error Doc pointed out
I don't get any yellow triangle. I have tried to change the name to IdProyecto in the query, but it keeps giving an error.
 
I don't get any yellow triangle. I have tried to change the name to IdProyecto in the query, but it keeps giving an error.
Try that expression:
Code:
=Nz(DSum("Importe";"CGastosEIngresos";"IdCategoria=2 And IdProyecto=" & Nz([IdProyecto];0));0)
 

Users who are viewing this thread

Back
Top Bottom