Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add field insame form but different field

Status
Not open for further replies.

rosayuni

Programmer
Jan 24, 2009
4
Hye,im newbies here.I have some problem about sum expression.I have one form and different field name.The problem here is,how to sum all field in that form.Is that true i do this:

last_byr=[dft_kpp]+[byr1_m]+[byr2_m]+[byr1_k]+[byr2_k]+
[t_k]+[p]

last_byr is grand total that i want and the rest is field name that i want total all.I put this calculation in properties>DATA tab>Control Source.I think,i do wrong for my calculation.Plz help me,i want urgent for that case..

Fyi,Im using MS ACCESS 2003..Thank you...
 
How are ya rosayuni . . .

Try this instead:
Code:
[blue]=Sum(Nz([dft_kpp]))+Sum(Nz([byr1_m]))+Sum(Nz([byr2_m]))+Sum(Nz([byr1_k]))+Sum(Nz([byr2_k]))+Sum(Nz([t_k]))+Sum(Nz([p]))[/blue]


See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
rosayuni . . .

Nz returns a zero for any data that is null.

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
so,where i put that code in ms access?coz,before this i put it at properties>data>control source.Is that right?Or else?
 
Same Place!

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
hello TheAceMan1,i try copy paste ur coding that u given before.When i paste at Control Source,and i try run,the calculation is wrong.I don't know why?Can u help me?
 
rosayuni . . .

Hmmmm ...

Try this:
Code:
[blue]=Sum(Nz([dft_kpp],0))+Sum(Nz([byr1_m],0))+Sum(Nz([byr2_m],0))+Sum(Nz([byr1_k],0))+Sum(Nz([byr2_k],0))+Sum(Nz([t_k],0))+Sum(Nz([p],0))[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top