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

Clearing a combo box

I have a databound form, frmClients. One of the field is a combo box,
comDepartment, which lets a user select a department for the Client.
But I can't figure out how to clear the box. That is, sometimes a Client is
dropped by a Department. How would a user clear the combo box so that no
Department is selected?
With the combo box dropdown style:
Dropdown: User must pick from the list, so there is no way of clearing the
box
Dropdown List: User can type a value. But even if the user deletes the
value, it won't be saved.

Suggestions please.
Thanks
Vayse
May 18 '07 #1
1 1729
Vayse,

I'm not sure I understand what you mean by clearing the combo box.

However, if you want to de-select the currently selected item, so that
nothing is selected in the combo box:

combobox1.SelectedItem = Nothing

or

combobox1.SelectedIndex = -1

or

combobox1.SelectedValue = some value not contained in the values collection

Kerry Moorman
"Vayse" wrote:
I have a databound form, frmClients. One of the field is a combo box,
comDepartment, which lets a user select a department for the Client.
But I can't figure out how to clear the box. That is, sometimes a Client is
dropped by a Department. How would a user clear the combo box so that no
Department is selected?
With the combo box dropdown style:
Dropdown: User must pick from the list, so there is no way of clearing the
box
Dropdown List: User can type a value. But even if the user deletes the
value, it won't be saved.

Suggestions please.
Thanks
Vayse
May 18 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Newbee | last post by:
Hola I wanted to kno how to clear the current text that is displayed in my combobox I am filling it with a query which is run against my database I have tried this but it not work ...
3
by: Alex Wisnoski | last post by:
I have an edit record form with several text boxes, combo boxes, and check boxes. All of them are bound except for one combo box (cboPositionData), which I use to search for a specific record. I...
2
by: Peter Bailey | last post by:
I have a function courtesy of the newsgroup that clears the list box. I would like to now set the listbox back to its initial state where you can see the first item in the list. The same goes for a...
3
by: rmatteson | last post by:
I am trying to figure out how to clear all items from a combobox (Access 2002). On my form, I have to comboboxes. Combobox 2 is populated with a set of child data dependent on the parent data...
2
by: Shannan Casteel via AccessMonster.com | last post by:
I have a table with information about different people...(i.e. Name, Address, Phone, Fax, etc.). The table has been linked to Access. I have created a combo box that uses this information. ...
2
by: ed | last post by:
Hello- i'm having some problems getting innerhtml to clear on mozilla, but it works fine in ie. my page is setup such that i have a div: <div id="otherModel"></div> on a select from a...
5
by: Geoff | last post by:
One of the entries in my subform is a field called . is populated by selecting from its drop down combo box which holds different text options I need to clear session if an invalid entry...
2
by: monikagovindaraj | last post by:
sir, I needed to clear the text boxvalue after refreshing the same page. actually im my program,the text box will be filled by using ajax.the value wil be assigned depends upon the previous...
7
by: Brad Pears | last post by:
I have something strange going on - pretty sure it used to work before - and now it does not... Why does the following code not clear a combo box? Me.cboLocation.Text = String.Empty OR ...
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: 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,...

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.