老师好!表A有“结果”和“结果建议”两项,分别作为两个复选列表框的数据表取值列,分别绑定到表B的“结果”和“结果建议”列,用下面的代码在第一个列表框选择项目后,第二个列表框也能选定对应行,但是表B的结果列有数据,结果建议列没有。请指点。谢谢!
Dim cst1 As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
Dim cst2 As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox2")
If cst1.GetItemChecked(cst1.SelectedIndex) = True Then
cst2.SetItemChecked(cst1.SelectedIndex,True)
End If
用下面的也不行
Dim cst1 As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox1")
Dim cst2 As WinForm.CheckedListBox = e.Form.Controls("CheckedListBox2")
For i As Integer = 0 To Tables("表A").Count - 1
If cst1.GetItemChecked(i) = True Then
cst2.SetItemChecked(i,True)
End If
Next
[此贴子已经被作者于2015/9/13 21:01:54编辑过]