按钮代码
Dim Filter As String
With e.Form.Controls("学段")
If .Value IsNot Nothing Then
Filter = "学段 = '" & .Value & "'"
End If
End With
With e.Form.Controls("学科")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "学科 = '" & .Value & "'"
End If
End With
With e.Form.Controls("教材版本")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "教材版本 = '" & .Value & "'"
End If
End With
Tables("题目抽取_题库").Filter = Filter
Dim lst As new List(of String)
Dim cnt As Integer = Tables("题目抽取_题库").rows.count
Dim i As Integer = Rand.Next(cnt)
Dim r As Row = Tables("题目抽取_题库").rows(i)
Dim cr As Row = Tables("题目抽取_人员").current
cr("学科") = r("学科")
cr("教材版本") = r("教材版本")
cr("讲课题目") = r("题目")
取消勾选,参考代码,AfterEdit事件
If e.Col.name = "选择" Then
If e.Row("选择") = True Then
For Each r As Row In e.Table.Rows
r("选择") = False
Next
e.Row("选择") = True
End If
End If