I prefer to use "Select Case" instead of "IF...End If" , but I don't get any errors when I run this code:
Code:
Private Sub btnReset_Click()
Dim ctl As Control
For Each ctl In Me.Controls
Select Case ctl.ControlType
Case acTextBox
If ctl.DefaultValue = "Date()" Then
ctl.Value = Date
Else
ctl.Value = ctl.OldValue
End If
Case acComboBox
ctl.Value = Null
End Select
' For Each ctl In Me.Controls
' ElseIf ctl.ControlType = acComboBox Then
' End If
Next ctl
End Sub
EDIT: Of course Linq is right..
I thought.... well, I don't know what I was thinking!