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
此程序稍一修改便可达到更多的功能如锁定或解锁各栏位
Public Sub LockControls(frm As Form, blnSta As Boolean)
Dim ctl As Control
For Each ctl In frm.Controls
If TypeOf ctl Is acTextBox Or TypeOf ctl Is acComboBox Then
ctl.Enabled = blnSta
DoEvents
End If
Next
End Sub