ProgramError
Programmer
I have a little routine which resets all the textboxes and combo boxes on the form to their default values except for two boxes which have dates as their default values. When reset, these put either =date() or date() (which IS the default value) instead of the expected date. I could check for these particular text boxes independently but would like to use the routine as a generic routine else where in other databases. Any ideas?
Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.
Code:
Private Sub ResetInputBoxes()
Dim ctrl As Control
For Each ctrl In Me.Form
If ctrl.ControlType = acTextBox Or ctrl.ControlType = acComboBox Then
ctrl = ctrl.DefaultValue
End If
Next
End Sub
Ian Mayor (UK)
Program Error
Always make your words sweet and nice. Because you never know when you may have to eat them.