473,399 Members | 3,832 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,399 software developers and data experts.

Clearing multiple combo boxes on a form when proceeding to next record

Hello,

I'm attempting to create a form where the multiple combo boxes are cleared when I proceed to the next record. I have applied the below code and it works to clear one of the combo boxes but not any of the others. I have applied this to each combo box by going to Properties -> Event tab -> On Click -> [Event Procedures].

Any help is greatly appreciated!


Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Current()
  2.     With Me
  3.         If .NewRecord Then .cboYourCombo = .cboYourCombo.DefaultValue
  4.     End With
  5. End Sub
Sep 21 '15 #1

✓ answered by Seth Schrock

Are you combo boxes bound or unbound?

5 1301
Seth Schrock
2,965 Expert 2GB
The OnClick event doesn't trigger when the form goes to a new record. The form's OnCurrent event does, which is what you have shown in your code above. You would need to add more lines like line 3 inside your With statement, changing the name of the combobox for each one.
Sep 22 '15 #2
You can use this:
Private Sub Form_Current()
Expand|Select|Wrap|Line Numbers
  1. On Error Go to ErrorHandler

Expand|Select|Wrap|Line Numbers
  1. Me![cboname of box]= Null
End Sub
Sep 22 '15 #3
Thank you! I was able to use this code to clear the combo boxes in my form. Unfortunately it doesn't appear to retain the information if I move to a new record, even if I have "saved" my form inputs using a save button. Are either of you familiar with why my text box information is saved while the combo box information is not?

Thank you again for your time and expertise!
Sep 22 '15 #4
Seth Schrock
2,965 Expert 2GB
Are you combo boxes bound or unbound?
Sep 22 '15 #5
I just realized that they are unbound. I was able to "bind" these combo boxes and now it works beautifully. Thank you so much!
Sep 22 '15 #6

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

Similar topics

1
by: Young J. Putt | last post by:
I have what I thought was a relatively simple data situation that I can't seem to get working using ADO.NET datasets and data binding. I have an "Issues" table which records the UserID of the user...
2
by: Damon Cherne | last post by:
Here is my issue. I have created a form called “Search” that has several unbound combo boxes, one for each of the attribute that match a column in the Table . Each combo box has input from a...
2
by: visionstate | last post by:
Hi there, I am working on a form that uses 3 text boxes and 3 combo boxes. When any data is entered into any of these, I click a command button and this requeries a sub query in the form and...
2
by: Pablo | last post by:
I have a Continuous Form based on the following table: sku, description, categoryId, subCategoryId I restrict the initial dataset to include one value for categoryId, but it may include...
1
by: Shawn Yates | last post by:
It has been a while since I have done anything on MS Access and I seem to be a bit rusty. I hope someone could help me solve my issue. I have a form that has multiple combo boxes on it. Each box...
12
by: micarl | last post by:
How would i print a report based on criteria selected from several Combo Boxes as well as multiple Multi Select List Boxes, that are located on the same form? I can get one Multi List Box, just...
1
by: Yasmeen Pannu | last post by:
HI, I am new to MS Access and stuck in a problem from few days. My Question: I have 3 combo box (Submitter, date from and date to) on my form and i want that when i select values from each of...
0
by: Svetlin Panov | last post by:
Hi Guys, I have a form with 48 Combo Boxes on it and I am filling them from the same range. I want to remove the values that are already selected not be available in the next ComboBox. I have...
10
by: jss787 | last post by:
Let me start by saying this is my first database. The problem I am having is I have 7 combo boxes on a form that are dependent on each other and only two of them are diplaying unique values. The rest...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.