Sintax to DSUM (?)

  • Thread starter Thread starter an
  • Start date Start date
A

an

I would like to know sintaxe to =DSUM...

To Sum in Main Form Textbox, all numeric values of fields
with same Id.

(Bad sample):

=DSum([EndKm]-[StartKm] Where [IdX]=[Forms]![F_MainForm]!
[IdX])

Thanks in advance.
an
 
The syntax is in the help file.

DSum(expr, domain, [criteria])

Using what you have:
=DSum("[EndKM]-[StartKm]", "TableOrQueryName", "[IdX]=" &
[Forms]![F_MainForm]![IdX])

This assumes that IdX is numeric, if it isn't, you'll have to concatenate in
quotes as well.
=DSum("[EndKM]-[StartKm]", "TableOrQueryName", "[IdX]=""" &
[Forms]![F_MainForm]![IdX] & """")
 
Ok, WM

Many thanks for your help.
Is exactly what I would like.
Have you a good weekend.
an

-----Original Message-----
The syntax is in the help file.

DSum(expr, domain, [criteria])

Using what you have:
=DSum("[EndKM]-[StartKm]", "TableOrQueryName", "[IdX]=" &
[Forms]![F_MainForm]![IdX])

This assumes that IdX is numeric, if it isn't, you'll have to concatenate in
quotes as well.
=DSum("[EndKM]-[StartKm]", "TableOrQueryName", "[IdX]=""" &
[Forms]![F_MainForm]![IdX] & """")

--
Wayne Morgan
MS Access MVP


I would like to know sintaxe to =DSUM...

To Sum in Main Form Textbox, all numeric values of fields
with same Id.

(Bad sample):

=DSum([EndKm]-[StartKm] Where [IdX]=[Forms]! [F_MainForm]!
[IdX])

Thanks in advance.
an


.
 
Back
Top