我有一个名为lstAvailable的列表框,我正在将选中的项目移动到名为lstAssigned的另一个列表框中,此处发送的值也存储在表tblComponents中。值存储在表中但我无法在列表框lstAssigned中看到移动的项目。有人能帮助我吗?
守则
nRid = listMachineSubSystem.Column(1)
For Each varRow In lstAvailable.ItemsSelected
nEid = lstAvailable.Column(0, varRow)
sSQL = "INSERT INTO tblComponents ([Machine Subsystem ID], [NewComponents])" _
& " VALUES (" & nRid & ", " & nEid & ");"
CurrentDb.Execute sSQL, dbFailOnError
Next varRow
lstAvailable.Requery
lstAssigned.Requery
For Each varItem In lstAvailable.ItemsSelected
lstAvailable.Selected(varItem) = False
Next
For Each varItem In lstAssigned.ItemsSelected
lstAssigned.Selected(varItem) = False
Next
End Sub