Hey guys,
was wondering if someone could tell me or point me in the rite direction how I can clear the contents of a listbox and all other feilds.
this is what I have upto now, and this clears texbox, checkboxes ect... but it wont clear contents that appears in a listbox:
Private Sub ClearFields()
Dim ctrl As Control
For Each ctrl In Me.Controls
If ctrl.GetType Is GetType(TextBox) Then
ctrl.Text = ""
ElseIf ctrl.GetType Is GetType(CheckBox) Then
Dim chkbx As CheckBox = ctrl
chkbx.Checked = False
ElseIf ctrl.GetType Is GetType(ListBox) Then
End If
Next
End Sub
if anyone can help me out tht wud be greatly appreciated
was wondering if someone could tell me or point me in the rite direction how I can clear the contents of a listbox and all other feilds.
this is what I have upto now, and this clears texbox, checkboxes ect... but it wont clear contents that appears in a listbox:
Private Sub ClearFields()
Dim ctrl As Control
For Each ctrl In Me.Controls
If ctrl.GetType Is GetType(TextBox) Then
ctrl.Text = ""
ElseIf ctrl.GetType Is GetType(CheckBox) Then
Dim chkbx As CheckBox = ctrl
chkbx.Checked = False
ElseIf ctrl.GetType Is GetType(ListBox) Then
End If
Next
End Sub
if anyone can help me out tht wud be greatly appreciated