473,669 Members | 2,458 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1741
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.Selec tedItem = Nothing

or

combobox1.Selec tedIndex = -1

or

combobox1.Selec tedValue = 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
2108
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 Combobox1.text = " am i using the wrong event
3
392
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 have a Clear button which I have coded to use the Me.undo if the form is dirty. I am testing for a situation in which the user would stop trying to enter data in cboPositionData and clear the form. When I enter a partial value in...
2
7961
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 combo box I am not sure after clearing how to get it back to show the first item. Regards Peter Function ClearList(lst As ListBox) As Boolean If lst.MultiSelect = 0 Then
3
3843
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 item selected in Combobox 1. This is done through the .AddItem method of Combobox 2 looping through the recordset. This works fine, until --> the data item in the Combobox 1 is changed, then Combobox 2 just appends the "new" related child data...
2
1449
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. There are eight columns in the combo box, seven of which are hidden. Therefore upon a selection the information that was hidden is now displayed on some labels at the bottom of the page. I used code similar to the following to make this work: ...
2
2284
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 combo box, in my javascript i execute: div = document.getElementById("otherModel"); depending on what's selected in a combobox, i execute:
5
2263
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 is made and I thought that the line
2
1848
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 combo box. after i refreshing the same page, the combo box refreshed, bt the text box hav the same value. i want to clear the text box value. help me
7
3576
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 Me.cboLocation.Text = ""
0
8465
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8383
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8895
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8809
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7407
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6210
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4386
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.