I have a listview and dataGrid and a recordset. when a user select an item from listview, that item is added into recordset and will be set to datagrid datasource
the brief code is like that.
'Defining recordset
Set rstDG = New ADODB.Recordset
rstDG.Fields.Append "Id", adDouble
rstDG.Fields.Append "PackedNo",adVarChar,255,adFldIsNullable
rstDG.Fields.Append "Deliver",adVarChar,255,adFldIsNullable
rstDG.Open
'In item check of listview, the selected item is added to RS
With rstDG
.AddNew
!Id = ListViewGoods.ListItems(i).SubItems(5)
!PackedNo = ListViewGoods.ListItems(i).SubItems(8)
!Deliver = ListViewGoods.ListItems(i).SubItems(9)
.Update
End With
but in "!Deliver = ListViewGoods.ListItems(i).SubItems(9)" I get this error "Multiple-step operation generated errors"
i can't understand that. "ListViewGoods.ListItems(i).SubItems(9)" contains a number , but i have tested it by direct assigning like
!Deliver = "5" or other value but nothing has changed.
Actually this problem arises when want to edit the values in the list( suppose i want to add an item to the existing list) but if i want to creat a new list and add new items in that new list everything is ok.
any idae is appreciated
the brief code is like that.
'Defining recordset
Set rstDG = New ADODB.Recordset
rstDG.Fields.Append "Id", adDouble
rstDG.Fields.Append "PackedNo",adVarChar,255,adFldIsNullable
rstDG.Fields.Append "Deliver",adVarChar,255,adFldIsNullable
rstDG.Open
'In item check of listview, the selected item is added to RS
With rstDG
.AddNew
!Id = ListViewGoods.ListItems(i).SubItems(5)
!PackedNo = ListViewGoods.ListItems(i).SubItems(8)
!Deliver = ListViewGoods.ListItems(i).SubItems(9)
.Update
End With
but in "!Deliver = ListViewGoods.ListItems(i).SubItems(9)" I get this error "Multiple-step operation generated errors"
i can't understand that. "ListViewGoods.ListItems(i).SubItems(9)" contains a number , but i have tested it by direct assigning like
!Deliver = "5" or other value but nothing has changed.
Actually this problem arises when want to edit the values in the list( suppose i want to add an item to the existing list) but if i want to creat a new list and add new items in that new list everything is ok.
any idae is appreciated