I had several forms with several controls on each. I wanted to clear each control, but I wanted to
I had several forms with several controls on each. I wanted to clear each control, but I wanted to make it as painless as possible. This code
Rate I had several forms with several controls on each. I wanted to clear each control, but I wanted to
(1(1 Vote))
Dim sMask As String
For Each Control In frm.Controls
If TypeOf Control Is TextBox Or TypeOf Control Is ComboBox Then
Control.Text = "" 'Clear text
End If
If TypeOf Control Is MaskEdBox Then
With Control
sMask = .Mask 'Save the existing mask
.Mask = "" 'Clear mask
.Text = "" 'Clear text
.Mask = sMask 'Reset mask
End With
End If
If TypeOf Control Is DTPicker Then
Control.Date = Date 'Set to current date
End If
Next Control
End Sub
I had several forms with several controls on each. I wanted to clear each control, but I wanted to Comments
No comments yet — be the first to post one!
Post a Comment