HUNTING101
New Member
- Joined
- Jan 7, 2007
- Messages
- 3
Trying to teach myself VBA so please be kind. I have a command button that I want to clear just the data shown in the user form.
This is the code that I have. All of the other data clears properly with the exception of the comboboxes.
Any help is appreciated.
Thanks in advance,
Matt
I have also tried
Case "Combobox"
oneControl.Value = -1
Case "Combobox"
oneControl.Value = Null
Case "Combobox"
oneControl.Value = NullString
Case "Combobox"
oneControl.Value = vbNullString
This is the code that I have. All of the other data clears properly with the exception of the comboboxes.
Any help is appreciated.
Thanks in advance,
Matt
Code:
Private Sub CommandButton10_Click()
Dim oneControl As Object
For Each oneControl In Form_Daily.Controls
Select Case TypeName(oneControl)
Case "TextBox"
oneControl.Text = NullString
Case "Combobox"
oneControl.Value = ""
Case "CheckBox"
oneControl.Value = False
End Select
Next oneControl
End Sub
Case "Combobox"
oneControl.Value = -1
Case "Combobox"
oneControl.Value = Null
Case "Combobox"
oneControl.Value = NullString
Case "Combobox"
oneControl.Value = vbNullString
Last edited by a moderator: