Clearing Values in a form

  • Thread starter Thread starter Haji
  • Start date Start date
H

Haji

Hello,

I have created a form with several text boxes in it.
There is also a command button that runs a report. In
this report are various calculations based on the form.
When I close my report it takes me back to the form with
the values I just plugged in. What I want to do is to
have a button on this form which clears all values and
allows me to start over and run another report. Is there
something that does this?

Thanks,

Haji
 
You would have to add code to a button. Basically...

Private Sub ResetButton_Click()
Field1 = ""
Field2 = ""
:
:
End Sub




Rick B




Hello,

I have created a form with several text boxes in it.
There is also a command button that runs a report. In
this report are various calculations based on the form.
When I close my report it takes me back to the form with
the values I just plugged in. What I want to do is to
have a button on this form which clears all values and
allows me to start over and run another report. Is there
something that does this?

Thanks,

Haji
 
Try something along the lines of

Dim ctl As Control

For each ctl in Me.Controls
If ctl.ControlType = acTextBox Then
ctl.Value = ""
End If
Next

Hope This Helps
Gerald Stanley MCSD
 
Back
Top