dsum on report getting #error

  • Thread starter Thread starter Alan
  • Start date Start date
A

Alan

=DSum("[Amount]"-"[Amount2]","Tabel1"," [CustomerNo] = " & [CustomerNo])


Have this on my report

my report fives me this

CustomerNo Amount Amount2 result

C00001 1000 1000 #error
C00002 1000 2000 #error

Please can some tell me why i'm getting error??
 
I'm not sure why DSum() is used when it looks like a simple control source
of
=Amount-Amount2
should work the same.


--
Duane Hookom
MS Access MVP

Marshall Barton said:
Alan said:
=DSum("[Amount]"-"[Amount2]","Tabel1"," [CustomerNo] = " & [CustomerNo])


Have this on my report

my report fives me this

CustomerNo Amount Amount2 result

C00001 1000 1000 #error
C00002 1000 2000 #error


You have the quotes around the names instead of around the
expression. Try it this way:

=DSum("Amount-Amount2","Tabel1","CustomerNo =" & CustomerNo)

All those [ ] were unnecessary so I removed them.
 
Back
Top