473,952 Members | 14,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Show ComboBox based on selection in Different ComboBox

I have a form with five comboboxes. In the first, the user can select
one of four items. The other four comboxes are hidden. Based on the
selection made in combobox one, I would like one of the comboxes to be
visible, and the other three to remain hidden.

Any suggestions?

Thanks.

Aug 16 '07 #1
2 2141
On Aug 16, 11:43 am, jujubean <harryzwee...@y ahoo.comwrote:
I have a form with five comboboxes. In the first, the user can select
one of four items. The other four comboxes are hidden. Based on the
selection made in combobox one, I would like one of the comboxes to be
visible, and the other three to remain hidden.

Any suggestions?

Thanks.
I would only use TWO combo boxes and change the data displayed in teh
2nd based on the current selection in the 1st.

Aug 16 '07 #2
Ben
On Aug 16, 8:43 am, jujubean <harryzwee...@y ahoo.comwrote:
I have a form with five comboboxes. In the first, the user can select
one of four items. The other four comboxes are hidden. Based on the
selection made in combobox one, I would like one of the comboxes to be
visible, and the other three to remain hidden.

Any suggestions?

Thanks.
Totally, just use two and set the rowsource of the second combo box
after the first is updated. Combo box 1 can even store the query for
the rowsource as part of its own rowsource so setting the source for
box 2 is just a reference to the correct column.

Or, if you must have four combo boxes then just use "if" statements to
turn them on.

if me.combo1 = 1 then
me.combo2.visib le = true
end if
if me.combo1 = 2 then
me.combo3.visib le = true
end if

Aug 16 '07 #3

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

Similar topics

1
1980
by: Steve | last post by:
I have a continuous form with several unbound comboboxes in the form header. The comboboxes are used to provide criteria for the SQL of the form. The code behind the form looks like: Public Sub FormSQL() Dim SQLStr As String SQLStr = < Code to build SQL String based on selection in comboboxes> SQLStr = SQLStr & ";" Me.RecordSource = SQLStr End Sub
2
4545
by: ross kerr | last post by:
Hi all, I have a control that extends the ComboBox object. It updates the selected item based on what the user enters in the text area. In the OnLeave event of the combobox, the selected index is set to the proper item. However, when accessing its selectedindex later it has reverted to the previous value. The selectedindex value is always one behind what
3
4686
by: Nikhil Patel | last post by:
Hi all, I am using the standard System.Windows.Forms.ComboBox controls on a form. There are 5 or 6 comboboxes and their selection depends on each other. The comboboxes behave strangely probably because there are two properties called SelectedIndex and selectedIndex. Both usually have different values. Has anyone experienced any problems using comboboxes? Thanks.
8
1999
by: Steve B. | last post by:
My Program: a local C# ADO.Net application using VS 2003 Right now I have about 5 ComboBox's which provides drop down selection entries from the same MS-Access table via a DataConnection, DataAdapter and DataSet datasource. Each CB has it's own DA and DS. When I tried to use the same DS as the datadource for each of the five CB's, changing one of the CB's selection affectd the other four CB's. New business requirements require I...
9
4159
by: Strahimir Antoljak | last post by:
Could anyone help me with the following: Is there a quick, or at least known way to force a ComboBox, having DropDownStyle= DropDownList, to recognize keyboard input and perform Item selection based on that. To be more specific: I have a list of 150 items (all 7-digit numeric values) represented in the combobox, and they are sorted. Instead
6
4926
by: ProteusGak | last post by:
Hi, new membership and first post. I am working in VB 2005, windows forms and would like to know how to open form2 based on the user's selection from a combobox or listbox from say, form1. Thank you, PG
4
6049
by: =?Utf-8?B?Q2hyaXM=?= | last post by:
I am trying to populate a DataGridView Combobox column with a different data binding source (dataset) depending upon a selection made in a previous column. I can handle the previous column but how do I assign the following properties dynamically in code? DataPropertyName DataSource DisplayMember I do see how to set these at design time but that won't do because I need
1
8075
by: The.Daryl.Lu | last post by:
Hi, two parts to my problem if someone can help address either one or both: 1. I want to SELECT everything in the table if it matches the criteria when the query button is pressed (this is just a commandbutton on my form). The biggest problem I'm having is that I can't (don't know how) populate a combobox on static items such as "True, False, Any." The Any field, would be selected by the user to find all records where that fields is...
1
2405
by: MiziaQ | last post by:
Hey, I have a problem which I need to resolve for my project. I want to open a different GUI class based on the selection made from a combobox: public void actionPerformed(ActionEvent event) { JComboBox comboBox = (JComboBox)event.getSource(); String selection = (String)comboBox.getSelectedItem(); if (selection == "Price Elasticity of Demand") { runGUI } How can I do this in java ?
0
10184
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
10003
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
11614
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...
1
11385
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9920
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
8289
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
7453
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
6367
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4972
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.