0
我对Access VBA相对较新,并且有一个窗体,其上有大约30个复选框。保存表格时,我想确保所有复选框都被打勾(设置为true)。 tickbox有所有名称SC1,SC2 .... SCN有没有办法循环每个控件,看看它是否已被设置为true? 这是我曾尝试,但它似乎没有阅读tickbox -访问VBA - 表单上的所有复选框已被检查
Private Sub Validate_Data(rstTop)
Dim n As Integer
Dim count As Integer
count = 0
For n = 1 To rstTop
If Form.Controls("SC" & n).Value = False Then
count = count + 1
End If
Next
If count <> 0 Then
MsgBox "Not all Questions have been ticked, please tick and add comments", vbInformation, _
"More information Required"
Else
End If
End Sub
这很有用,谢谢PeterT – Gablet 2015-04-04 08:48:22