Add Table field values using VBA

L

Les

Hi, I have tried the following in the control Source of the text box:-

=DSum("[Kufner]+[Steyn]+[Remondini]+[Stadler]","tblTotalByrSuppliers")

In Other words i need to add the value of [kufner] (1), the value of
[Steyn](0), [Remondini](0)& [Stadler](1), giving me a total of 2.

I know it is not correct, but maybe this will give you an idea of what
i
am trying to achieve, maybe there is a way with code ?
 
G

George Nicholson

=DSum("[Kufner]","tblTotalByrSuppliers") +
DSum("[Steyn]","tblTotalByrSuppliers") + (etc)


HTH,
 
L

Les

Hello George, i have established that my code and yours work, but only
if there is a value ? I am making the table from a query, so some names
have no value and then the code does not work, any suggestions ??
 
D

Douglas J Steele

=Nz(DSum("[Kufner]","tblTotalByrSuppliers"), 0) +
Nz(DSum("[Steyn]","tblTotalByrSuppliers"), 0) + (etc)
 
Top