PDA

Click to See Complete Forum and Search --> : Grand total in Textbox


qassim
Jan 19th, 2000, 05:34 PM
I have field named amount in access tabel i want to grand
total from amount field in text box it will update too
when I enter amount in amount field
plz reply me soon
Thank You

HarryW
Jan 19th, 2000, 05:57 PM
Grand total of the "Amount" field:

data1.recordset.movefirst
Do until EOF
total = total + data1.recordset.fields("Amount")
data1.recordset.movenext
Loop

To update your textbox every time, put it in the text1_change event. I think that's what the event's called. Haven't used VB for a while.

Hope that's what you want :)

JHausmann
Jan 20th, 2000, 09:02 AM
SQL solution:

select sum(amount) from table