A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Clearing Values in a form



 
 
Thread Tools Display Modes
  #1  
Old July 9th, 2004, 09:08 PM
Haji
external usenet poster
 
Posts: n/a
Default Clearing Values in a form

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
  #2  
Old July 9th, 2004, 09:47 PM
Rick B
external usenet poster
 
Posts: n/a
Default Clearing Values in a form

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

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




Rick B




"Haji" wrote in message
...
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


  #3  
Old July 9th, 2004, 10:49 PM
Gerald Stanley
external usenet poster
 
Posts: n/a
Default Clearing Values in a form

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
-----Original Message-----
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
.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Form. Should I use Control or Form Toolbar? Amy General Discussion 7 July 1st, 2004 02:36 PM
How to syncronize a datasheet form and single form? Sandra Using Forms 9 June 16th, 2004 05:24 AM
form doesn't update!!!!! manish Using Forms 4 June 15th, 2004 11:24 AM
surely a form with a ListBox can be used in a query? 1.156 Running & Setting Up Queries 14 June 2nd, 2004 04:54 PM
Form Does Not Go To New Record Steve New Users 1 May 12th, 2004 03:15 AM


All times are GMT +1. The time now is 03:16 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.