i am using VB 6.0 and MSAccess in my project.. in one of the forms i use a flexgrid to store data into and load data from database. and also to edit each cell i use a textbox.
alll these are working perfect, bt i have a problem with saving the edited data..i.e i load data from DB and then after editing i need to make changes in the DB ..
but it doesnt work,
this is the code i use load and save data..
code for save data
For a = 1 To i - 1
rs!item_code = flex.TextMatrix(a, 1)
rs!part_no = flex.TextMatrix(a, 2)
rs!item_dec = flex.TextMatrix(a, 3)
rs!qty = flex.TextMatrix(a, 4)
rs!Rate = flex.TextMatrix(a, 5)
rs!unit = flex.TextMatrix(a, 6)
rs!amt = Val(flex.TextMatrix(a, 7))
rs.Update
rs.Requery
Next a
this is the code to load data from DB
rs.MoveFirst
For a = 0 To rs.RecordCount - 1
flex.TextMatrix(a + 1, 1) = rs!item_code
flex.TextMatrix(a + 1, 2) = rs!part_no
flex.TextMatrix(a + 1, 3) = rs!item_dec
flex.TextMatrix(a + 1, 4) = rs!qty
flex.TextMatrix(a + 1, 5) = rs!Rate
flex.TextMatrix(a + 1, 6) = rs!unit
flex.TextMatrix(a + 1, 7) = rs!amt
rs.MoveNext
Next a
is there a way to edit the exizting data of DB using a flexgrid ? or do i have to write an UPDATE query and execute it ?
can someone plz help me with this ?