Resetting Form Field Values

John Baker

Registered User.
Local time
Today, 14:32
Joined
Apr 13, 2005
Messages
35
I have a form that I use to collect selection criteria for reports. The controls on the form are combo boxes and date fields. After I run the report, I would like all of the fields on the form to be cleared of the selected values that were used to run the previous report. I have tried the 'repaint' method but it does not work.

Any suggestions?

Thanks,
John
 
Put this code behind the button that prints your reports.

Code:
 ' Clear all [B]unbound [/B]controls and combo boxes
Dim ctl As Control
For Each ctl In Me.Controls
    If ctl.ControlType = acComboBox Or ctl.ControlType = acTextBox Then
        ctl.Value = ""
    End If
Next ctl
Set ctl = Nothing
 
Thanks, works perfectly!
 

Users who are viewing this thread

Back
Top Bottom