VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



To Clear all the values in Form (No matters name of object)

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)

Rate 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

Download this snippet    Add to My Saved Code

To Clear all the values in Form (No matters name of object) Comments

No comments have been posted about To Clear all the values in Form (No matters name of object). Why not be the first to post a comment about To Clear all the values in Form (No matters name of object).

Post your comment

Subject:
Message:
0/1000 characters