473,395 Members | 1,568 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,395 software developers and data experts.

Can I use one clear button/vba command to clear combo boxes and text boxes?

Currently I have a form that has bound text boxes and combo boxes on it. Some of the combo boxes are pulling the information from other tables and some are manually entered in. I would like to create a reset form buttn for the form, but not sure how to do that for multiple commands.
Jun 2 '14 #1

✓ answered by NeoPa

Expand|Select|Wrap|Line Numbers
  1. Me.Undo()
This will reset all pending updates for all bound controls on your form and leave the record as it was before any changes were entered.

Otherwise, Jim's post says it all pretty-well. Generally controls would be set to Null where possible, but in some circumstances that isn't possible so setting to a specific ("" or 0) value is called for.

4 2044
jimatqsi
1,271 Expert 1GB
Denielle, depends what you mean by "reset." This sounds like a "advance to new record" request, which would clear all the fields to allow you to enter new data, but would also save any changes on the record currently being edited. But when you start a new record in an Access form fields with default values may not show as "cleared" but with the defaults filled in.

If that is what you want, great. If you want everything being completely cleared you might want to add a button specifically for that purpose and clear each field with me.whatever="" or =0.

Jim
Jun 2 '14 #2
NeoPa
32,556 Expert Mod 16PB
Expand|Select|Wrap|Line Numbers
  1. Me.Undo()
This will reset all pending updates for all bound controls on your form and leave the record as it was before any changes were entered.

Otherwise, Jim's post says it all pretty-well. Generally controls would be set to Null where possible, but in some circumstances that isn't possible so setting to a specific ("" or 0) value is called for.
Jun 2 '14 #3
Thank you for the response. Just to clarify, no it is not for an enter and move to new record. I am wanting to use it to clear the form if someone makes an error when entering the information. That way they can click on the clear (reset) button and clear out the entire form to start over. There are over 40 controls on the form so I was trying to see if I could use one code for all for a reset instead of listing all of them in the code. will the code listed below do that? Thanks

Expand|Select|Wrap|Line Numbers
  1. Me.Undo()
  2.  
Jun 4 '14 #4
jimatqsi
1,271 Expert 1GB
Yes, that will undo any changes since the last save or since moving to that record, whichever came most recently.
Jun 4 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: gav1972 | last post by:
Working on this piece of code but when i click on my add button in the form the text boxes that i am using do not clear and so i can't add a new record any help would be great. The code for my data...
4
by: Chansen | last post by:
I have a form with mulitple combo boxes that populates criteria in a query. I want to add a button to clear the selections in all of the combo boxes. What code do I use? Thanks!
3
by: winky10 | last post by:
From a newbie. MSAccess 2000. I have a form with checkboxes and text boxes bound to their respective fields in a table. Using a query, I am able to create a report based on those checked boxes. ...
1
by: gosens | last post by:
Hello, I am hoping some one could help me out with the code for this one. Basically what i am trying to do is for a simple cash register system give a person the ability to enter a barcode...
0
by: gosens | last post by:
Hello, I am hoping some one could help me out with the code for this one. Basically what i am trying to do is for a simple cash register system give a person the ability to enter a barcode...
1
by: dmj07 | last post by:
Hi, I have created a gridview and auto-generated the edit button on there. What I need to know is, when I press the edit button can I reference the text boxes that appear? I am using boundfields...
9
by: RICHARD BROMBERG | last post by:
Please bear in mind that I am a newbie. I am posting this question a second time because the responses to my earlier post were a little wide of the mark. So, here goes: I am using Access 2000...
11
by: jwessner | last post by:
I have a form (Form1) which contains basic Project data and a subform listing the personnel assigned to the Project as a continuous form. Selecting a person on that project and clicking on a command...
1
by: stewdizzle | last post by:
I have a from with three radio buttons (same group) and three text boxes. The radio buttons give the user a choice of uploading one, two, or three images. Currently, I have the text boxes load as...
1
by: Marie Gardner | last post by:
Hi, I want to create a form that filters a report that is between a date range, and includes only the data for the item selected in the combo box. For example, I am creating a time manager...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.