by Raghuraja. C (21 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 17th February 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)
To Clear all the values in Form (No matters name of object)
'To clear the object
On Error GoTo LOCALERRORHANDLER
'------------------------------------------
'To clear the Text box flxgrid form as parameter
'------------------------------------------
Dim objCLR
For Each objCLR In frmObj
'-----------------------------------------
'If Text Box/Combo Box/Masked Edit Control/List Box
'-----------------------------------------
If TypeOf objCLR Is TextBox Or _
TypeOf objCLR Is ComboBox Or _
TypeOf objCLR Is MaskEdBox Then
'To clear Text Box Combo
objCLR.Text = ""
'-----------------------------------------
'If Grid Control
'-----------------------------------------
ElseIf TypeOf objCLR Is MSFlexGrid Then
objCLR.Clear
'-----------------------------------------
'If Label
'-----------------------------------------
ElseIf objCLR.Name = Label Then
objCLR.Caption = ""
End If
Next
Exit Function
LOCALERRORHANDLER:
End Function