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