Public Sub ClearD(frm As Form)
Dim ctl As Control
For Each ctlControl In frm.Controls
If TypeOf ctl Is acTextBox Or TypeOf ctl Is acComboBox Then
ctl = ""
DoEvents
End If
Next
End Sub
---竹笛喜欢老猫烧须--------
执行:
Private Sub 命令4_Click()
Call ClearD
End Sub
------
函数:
Public Sub ClearD()
Dim ctrl As Control
For Each ctrl In Me.Form.Controls
If TypeOf ctrl Is TextBox Or TypeOf ctrl Is ComboBox Then
ctrl = ""
DoEvents
End If
Next
End Sub
-----或许可以-------
Public Function ClearD(frm As Form)
Dim ctrl As Control
For Each ctrl In frm.Controls
If TypeOf ctrl Is TextBox Or TypeOf ctrl Is ComboBox Then
ctrl = ""
DoEvents
End If
Next
End Function