954,535 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Add values of cl

Hi Frns,

Plz som1 help me, I want to add the values of a coloumn in MS Access db, I m using Visual Basic as a front end. The total should be displayed on the Form. So if possible then plz tell me the VB coding.
Thnx in advnce.

Sinha's
Light Poster
37 posts since Apr 2006
Reputation Points: 10
Solved Threads: 0
 
Dim db as database
Dim rs as recordset
set db = opendatabase("Access_Database_Path")
set rs = db.Open("Table_Name")
Dim mTotal
Do until rs.EOF
   mTotal = mTotal + rs("ColumnName")
   rs.MoveNext
Loop
Text1.text = mTotal
rs.Close
db.close
set rs = nothing
set db = nothing
aparnesh
Junior Poster
194 posts since Jul 2005
Reputation Points: 20
Solved Threads: 10
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You