E
Edson
Guys,
I've wrote the following code in order to clean a form:
Private Sub cmdCancel_Click()
For Each C In Form1.Controls
If TypeOf Control Is TextBox Then
C.Value = Null
ElseIf TypeOf C Is ComboBox Then
C.ListIndex = -1
End If
Next
End Sub
This code works *ONLY* for ComboBox type, and ignore all textboxes (the
contents aren't cleaned).
Where I'm wrong?
I've wrote the following code in order to clean a form:
Private Sub cmdCancel_Click()
For Each C In Form1.Controls
If TypeOf Control Is TextBox Then
C.Value = Null
ElseIf TypeOf C Is ComboBox Then
C.ListIndex = -1
End If
Next
End Sub
This code works *ONLY* for ComboBox type, and ignore all textboxes (the
contents aren't cleaned).
Where I'm wrong?