'Routine to reset your controls 'This can be handy to use after you have update a record and need t
'Routine to reset your controls 'This can be handy to use after you have update a record and need to reset 'the controls for the next entry
Rate 'Routine to reset your controls 'This can be handy to use after you have update a record and need t
(1(1 Vote))
'This can be handy to use after you have update a record and need to reset
'the controls for the next entry
Private Sub resetAll()
Dim ctrlX As Control
'reset all the control values
For Each ctrlX In Controls
If TypeOf ctrlX Is TextBox Then ctrlX.Text = ""
If TypeOf ctrlX Is CheckBox Then ctrlX.Value = 0
If TypeOf ctrlX Is OptionButton Then ctrlX.Value = False
Next ctrlX
End Sub
'Note
'You can asign any vb internal contol to the var and then manipulate the
'proprties as needed
'The class name of all Visual Basic internal controls.
'Remarks
'You can dimension a variable as a Control object and reference it as you would a control on a form.
'The following demonstrates this:
'Dim C as Control
'Set C = Command1
'Routine to reset your controls 'This can be handy to use after you have update a record and need t Comments
No comments yet — be the first to post one!
Post a Comment