Clearing Values in a form

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
 
R

Rick B

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
 
G

Gerald Stanley

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top