日期:2014-05-16  浏览次数:21094 次

如何清空窗体里的文本,标签,组合框都清空?
如题谢谢
我做的一个窗体,

有组合框,文本,标签等,
想一键清除所有的填写值,然后重新填写

------解决方案--------------------
For Each ER In Me.Controls
MsgBox ER.Name & ER.ControlType
If ER.ControlType = acTextBox Then
ER.Value = " "
End If
If ER.ControlType = acLabel Then
ER.Caption = "123 "
End If
Next
------解决方案--------------------
Dim er

For Each er In Me.Controls
MsgBox er.Name & ", " & er.ControlType
If er.ControlType = acTextBox Then
er.Value = " "
End If
If er.ControlType = acLabel Then
er.Caption = " "
End If
If er.ControlType = acComboBox Then
er.Value = " "
End If
Next