G
Guest
Hello, my multi-select list box that has 2 columns, called Ex_Code and
Auth_Ex. I am trying to append the selected items in the list box to a table
called "Update Tbl". I know how to read the first column by using
Me.lstAuth_Ex.ItemData(iCount), but I don't know how to read the 2nd column.
I am trying Me.lstAuth_Ex.Column(1, iCount) to read the 2nd column, but this
code return null value. Any insight will be helpful!!
This is my current code:
Set rstSel = db.OpenRecordset("UpdateTbl")
If Me.lstAuth_Ex.ListCount <> 0 Then
For iCount = 0 To Me.lstAuth_Ex.ListCount - 1
Me.lstAuth_Ex.Selected(iCount) = True
With rstSel
.AddNew
.Fields(0) = Me.txtSelBusLine.Value
.Fields(1) = Me.lstAuth_Ex.ItemData(iCount) 'Ex_Code
.Fields(2) = Me.lstAuth_Ex.Column(1, iCount) 'Exchange Name
.Update
End With
Me.lstAuth_Ex.Selected(iCount) = False
Next
End If
Auth_Ex. I am trying to append the selected items in the list box to a table
called "Update Tbl". I know how to read the first column by using
Me.lstAuth_Ex.ItemData(iCount), but I don't know how to read the 2nd column.
I am trying Me.lstAuth_Ex.Column(1, iCount) to read the 2nd column, but this
code return null value. Any insight will be helpful!!
This is my current code:
Set rstSel = db.OpenRecordset("UpdateTbl")
If Me.lstAuth_Ex.ListCount <> 0 Then
For iCount = 0 To Me.lstAuth_Ex.ListCount - 1
Me.lstAuth_Ex.Selected(iCount) = True
With rstSel
.AddNew
.Fields(0) = Me.txtSelBusLine.Value
.Fields(1) = Me.lstAuth_Ex.ItemData(iCount) 'Ex_Code
.Fields(2) = Me.lstAuth_Ex.Column(1, iCount) 'Exchange Name
.Update
End With
Me.lstAuth_Ex.Selected(iCount) = False
Next
End If