Hi all ! I am using vb6 and Datagrid ! I have an access database and i display those records in datagrid ! For example, there is a column named marks ! Below the datagrid there is a button and textbox named total ! if i click the button means, then the marks column in the datagrid should be added and display the result in the textbox ! I have tried the following method but it doesn't work !
The marks column in the access is displaying correctly in the datagrid ! but i don't know how to take the values from the datagrid and add them up and display the total marks in a textbox ! Thanks in advance !
Public con As New ADODB.Connection Public rs As New ADODB.Recordset In the form load the following code contains ! Set con = New ADODB.Connection con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=.\college.mdb;Persist Security Info=False" con.CursorLocation = adUseClient Set rs = New ADODB.Recordset rs.open "select marks from student",con,1,3 set Datagrid1.Datasource = rs
The marks column in the access is displaying correctly in the datagrid ! but i don't know how to take the values from the datagrid and add them up and display the total marks in a textbox ! Thanks in advance !