Hi all,
I am trying to do updating multiple data from list box,
in the sample its showing only how to update the single data using ID,
Listbox 1
Apple 2
orange 2
so I wanted to write in to database, inserting the new record if the item is not exist and update all the match item’s quantity.
if its only calculating between list box, i can do it, but the problem is, how to update the database.
here’s the code
[code] Dim o, i as integer
dim row as integer
row =Listbox4.listcount-1
dim the_code as string
dim bFound as boolean
bFound = false
For o = 0 to row
the_code = listbox4.cell(o,4)
For i = 0 To Customerslist1.ListCount - 1
If Customerslist1.ListCount >0 then
If Customerslist1.cell(i,2) = the_code then
Customerslist1.cell(i,9)=str(val(Customerslist1.cell(i,9))+val(Listbox4.cell(o,8)))
bFound = true
Customerslist1.cell(i,12)=str(val(Customerslist1.cell(i,9))+val(Customerslist1.cell(i,10))+val(Customerslist1.cell(i,11)))
End if
end if
Next
Next[/code]
this code only change the value on the list box(customerslist1) based from Listbox4, not updating the database.
any help…?
sorry for my poor English.
Thanks
Arief