我想循環顯示窗體上的所有UNBOUND控件,並清除其數據或重置其值。我有文本框,組合框和複選框。每次我嘗試這樣的事:循環顯示窗體上的所有未綁定控件並清除數據
Dim ctl As Control
For Each ctl In Me.Controls
If IsNull(ctl.ControlSource) Then
ctl.Value = Nothing
End If
Next ctl
我得到一個運行時錯誤說:
438這個對象不支持此屬性或方法。
嘗試'ctl.ControlSource = 「」',而不是'如果ISNULL(ctl.ControlSource)'... – 2013-03-11 21:14:13
完全相同的錯誤... – prayingmantes 2013-03-11 21:17:55