473,387 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

resetting a form

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
8 2859
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
Nope, tried that as well.
>>
Will Me.Undo work?

May 12 '07 #3
"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
"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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: timchalk | last post by:
I believe I've found a problem with the Safari DOM when updating the text found within a layer. Although the layer is updated correctly visually, the underlying DOM seems to grow larger with...
3
by: Susan Bricker | last post by:
I might not have phrased the question correctly in the Subject of this post. Please read the entire explanation. I have a form with a command button (Add New Person). This button opens up...
2
by: DeveloperPDX | last post by:
I am creating a page and I need to add a reset button (like you would with HTML forms). Is there any way to do this other than resetting individual controls? Basically I need to page to return to...
1
by: Matthew Wieder | last post by:
Hi - I wanted to capture the enter button on a form since I have a datagrid with the first column being a delete button and if someone hits enter it deletes the first record. I coded: private...
4
by: Ian Davies | last post by:
Hello I am struggling for a solution to clear some fields on my webpage that takes their values from some sessions My solution below works when the button is clicked twice. I sort of know why I...
2
by: =?Utf-8?B?TWljaGFlbA==?= | last post by:
Hi Everyone. I was using the following code in VB6, but am in the middle of converting the app to VB.Net 2005. He is the code Private Sub ClearAll() On Error GoTo Error_Routine Call...
0
by: =?Utf-8?B?TWFyaw==?= | last post by:
I'm trying to create a visual aid program to mimic a VIPP layout. In VB.NET the screen origin (0,0) is the top left hand corner of the screen. Is there a way to reset the origin to the bottom left...
2
by: RLN | last post by:
RE: Access 2003 I wanted to turn off right clicking on forms so users couldn't go into design mode and change stuff. I have a special "programmers' form that, when a password is put in, enables...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
I placed a button on a form menustrip for the purpose of causing the horizontal scrollbar of my form to appear so that I can access controls outside of the form's current view (the controls are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.