By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,601 Members | 1,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,601 IT Pros & Developers. It's quick & easy.

resetting a form

P: n/a
I'm using a form where users can input a bunch of info into unbound text
controls that are used in series of calculations. At the bottom is a "reset"
button. I want to clear out all of the user inputs on the form by clicking
the button. Me.Refresh .requery .repaint do not work. Any suggestions?
May 11 '07 #1
Share this Question
Share on Google+
8 Replies


P: n/a
Kevin wrote:
I'm using a form where users can input a bunch of info into unbound text
controls that are used in series of calculations. At the bottom is a "reset"
button. I want to clear out all of the user inputs on the form by clicking
the button. Me.Refresh .requery .repaint do not work. Any suggestions?

Will Me.Undo work?
May 11 '07 #2

P: n/a
Nope, tried that as well.
>>
Will Me.Undo work?

May 12 '07 #3

P: n/a
"Kevin" <no**@email.comwrote in message
news:YW********************@fe02.news.easynews.com ...
I'm using a form where users can input a bunch of info into unbound text
controls that are used in series of calculations. At the bottom is a "reset"
button. I want to clear out all of the user inputs on the form by clicking the
button. Me.Refresh .requery .repaint do not work. Any suggestions?
You either have to use code to set all the controls to Null, either in a loop or
one at a time or if this really is an unbound form it is often just as good to
simply close it and reopen it.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com
May 12 '07 #4

P: n/a
"Kevin" <no**@email.comwrote
I'm using a form where users can input a bunch
of info into unbound text
controls that are used in series of calculations. At the bottom is a
"reset" button. I want to clear out all of the user inputs on the form by
clicking the button. Me.Refresh .requery .repaint do not work. Any
suggestions?
If you have a great many Controls on the Form, you can write code to iterate
through the Form's Controls Collection, testing for Control Type, and
resetting to Null (or zero for numeric or empty string for text, if you
prefer). If you have a small number of Controls, it will be as simple to
just individually set each to your chosen default value.

Larry Linson
Microsoft Access MVP

May 12 '07 #5

P: n/a
DoCmd.RunCommand (acCmdUndo)

"Larry Linson" <bo*****@localhost.notwrote in message
news:1r91i.4679$cu1.978@trnddc01...
"Kevin" <no**@email.comwrote
I'm using a form where users can input a bunch
of info into unbound text
controls that are used in series of calculations. At the bottom is a
"reset" button. I want to clear out all of the user inputs on the form by
clicking the button. Me.Refresh .requery .repaint do not work. Any
suggestions?

If you have a great many Controls on the Form, you can write code to
iterate through the Form's Controls Collection, testing for Control Type,
and resetting to Null (or zero for numeric or empty string for text, if
you prefer). If you have a small number of Controls, it will be as simple
to just individually set each to your chosen default value.

Larry Linson
Microsoft Access MVP

May 19 '07 #6

P: n/a
Since the controls are unbound, they have no data type so setting them to a
zero length string will do just fine!

Private Sub YourCommandButton_Click()
Dim ctrl As Control
For Each ctrl In Me.Controls
If TypeOf ctrl Is TextBox Then
ctrl.SetFocus
ctrl.Text = ""
End If
Next
End Sub

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200705/1

May 19 '07 #7

P: n/a
Forgot to add yesterday, the reason that the previous attempts of Me.Refresh,
Me.Requiry, Me.Undo and DoCmd.RunCommand (acCmdUndo) didn't work is that this
is an UNBOUND form! These all are used for BOUND forms!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via http://www.accessmonster.com

May 19 '07 #8

P: n/a
I forgot something as well. When I said that DoCmd.RunCommand (acCmdUndo)
did work. That was after I changed the form to a bound form. Never even made
the connection that binding the form would change that.
"missinglinq via AccessMonster.com" <u28780@uwewrote in message
news:726dc3a0a2550@uwe...
Forgot to add yesterday, the reason that the previous attempts of
Me.Refresh,
Me.Requiry, Me.Undo and DoCmd.RunCommand (acCmdUndo) didn't work is that
this
is an UNBOUND form! These all are used for BOUND forms!

--
There's ALWAYS more than one way to skin a cat!

Answers/posts based on Access 2000

Message posted via http://www.accessmonster.com

May 19 '07 #9

This discussion thread is closed

Replies have been disabled for this discussion.