读书人

怎么清空窗体里的文本,标签,组合框都清

发布时间: 2012-03-18 13:55:39 作者: rapoo

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

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

[解决办法]
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

读书人网 >Access

热点推荐