Have One Combo Box Populate Another Based On Selection?

Jun 22, 2010

I am currently stuck in one part of my application. I have two combo boxes that i am having the users select from. The first combo box is simply bound to a datatable. that is working properly. The second one i need to populate off another datatable after sorting out what the first one is requesting. Basically it's choosing a line number on the first box and then selecting the machine associated with that line number.[code]...

View 4 Replies


ADVERTISEMENT

Populate Combox Based Upon Selection Of Another Combobox?

May 17, 2012

I'm new to programming and I'm using vb.net 2010 and I'm stuck with this problem. So here are the details, I have 2 tables in my database, a product table and a category table. In my product table I have product no, product description and category no. In the category table i have category no and category desciption. So this is where Ive been stuck for the entire day, I want my combox(product) to populate based on what is in the combobox(category). For example I have "Chair" in my combobox(category), then what would appear in the combobox(product) would be "sofas", "dining chair" etc.'the part below is where the program will read the category description from my database

Sub fillcomboDesc()
Dim fillcatDesc As MySqlCommand = New MySqlCommand("Select catDesc from category;", connection)

[code]....

View 2 Replies

Populate Textbox Based On ComboBox Selection Not Using Databinding

Apr 27, 2010

I have a form, frm1 w/a combobox, cboLocations, which is being populated using a sql string. There is also a frm2 w/a series of textboxes and other comboboxes. I want it so that once a selection is made from cboLocations, the textboxes and comboboxes on frm 2 are populated with the corresponding data. Here is what I have so far:

frm1:
Public Class frmLocations
Dim conn As New SqlConnection("Data Source=f03d3s-dev01; Initial Catalog=dos_track;User Id=vbuser; Password=tran3;")
Dim depot_refnbr As Integer
Private Sub frmLocation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
conn.Open()
[Code] .....

What's happening right now is that I make a selection from cboLocations on frm1 and click on the OK button, frm2 loads, but none of the textboxes are populating and one of the comboboxes, cboDepot, shows the different data when you click on the down arrow, but it's not displaying anything it its text field when frm2 loads.

View 14 Replies

Adding Numbers From A Datagridviw Based On A Combo Box Selection?

Feb 22, 2012

In my below forms, the user select a name from the combo box list and enters an amount for the name selected. The user can enter as many entries. Every time the total button is clicked, I would like the total for each person to be display on the labels.

View 1 Replies

Forms :: Populate Textboxes Based On Combobox Selection NOT Using Databinding?

Apr 27, 2010

how to go about this? I have a form, frm1 w/a combobox, cboLocations, which is being populated using a sql string. There is also a frm2 w/a series of textboxes and other comboboxes. I want it so that once a selection is made from cboLocations, the textboxes and comboboxes on frm 2 are populated with the corresponding data. Here is what I have so far:

frm1:
Public Class frmLocations
Dim conn As New SqlConnection("Data Source=f03d3s-dev01; Initial Catalog=dos_track;User Id=vbuser; Password=tran3;")
Dim depot_refnbr As Integer

[Code]...

What's happening right now is that I make a selection from cboLocations on frm1 and click on the OK button, frm2 loads, but none of the textboxes are populating and one of the comboboxes, cboDepot, shows the different data when you click on the down arrow, but it's not displaying anything it its text field when frm2 loads.

View 4 Replies

VS 2008 - Populate Master / Detail Datagridviews Based On A Combobox Selection?

Apr 14, 2009

I have a product table with ProductId,ProductName,ProductCode as fields. I've populated a combobox with productnames. Next I have two other tables called Result_Header and Result_Detail. The Result_Header table has ProductId as a foreign key and BatchNo,TestDate etc. The Result_Detail table has ResultId as a foreign key which is the ResultHeaders Primary Key and other fields such as Result,SpecHi etc. What I need is when I select a Product from my combobox my two datagridviews must be populated via the Result_header and Result_detail tables respectively.

View 20 Replies

VS 2010 Populate Textbox With Excel Data Based On Combobox Selection?

Nov 29, 2011

Visual Basic 2010 Express: I have a form with a combobox that is populated with the names of locations from a datagrid which in turn was imported at run-time (Form_Load) from an Excel database. The Excel database (and the datagrid) also stores the information for addresses and phone numbers for their respective locations.

What I would like to do is have the phone number and address text boxes automatically be updated with the proper corresponding data when the user selects a location from the combobox. Whether the text boxes are updated from the datagrid or Excel database is not a concern; I'm mainly looking for whichever way is simpler.

View 3 Replies

Javascript - Change Values In Combo Box By Selection In First Combo Box?

Jan 12, 2012

I've got some code like the following. I want it so that when I chose an item in 'select 1' it changes the in the second combo box but I'm not sure of the best way to go about it. Does it have to be AJax or can it be done with just Javascript?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

[code].....

View 5 Replies

Object Null Combo - Error When Try To Populate Some Combo Boxes With A Value

Nov 16, 2011

I am getting an error when i try to populate some combo boxes with a value, the combo box has values in and the right amount the code is getting the right number.

the error msg is "Object reference not set to an instance of an object."

View 7 Replies

Populate A Datagridview With A Selection From A Combobox?

Apr 9, 2012

How can i bind a comobox selection to a datagridview without writting code...

i Need to select an item from a combox and based on that item refresh the datagrdiview. I did something like that in Access but i don't know how to make it work in visual studio 2008.

once i select the datagridview itme that i want to edit i'd like to be able to update back to the database. I know i need to write code for this but at least i'll have the data refreshed on the datagridview.

View 3 Replies

Populate A Listbox When A Selection Is Made

Feb 23, 2011

I am currently using the NorthWindDataSet from the msdn tutorials.So far, here is what I have to populate one of the listboxes on my form:[code] I make a selection in ListBox2 I would like ListBox3 on my form to be populated with that particular person's Order #'s.

View 2 Replies

Populate Data From Tbl To Txt Depending On Ddl Selection?

Jul 14, 2010

I have a web page where I am trying to populate the PSI # into the txtPSI depending on which customer is selected in ddlCustomers.I have written it a way it has worked on a past project and it compiles with no errors, however it doesn't work when it runs.

The code adder is not working so I had to add it manually.

Protected
Sub ddlCustomers_SelectedIndexChanged(ByVal
sender As

[code]....

View 5 Replies

Populate Listbox Without A Default Selection?

Feb 3, 2011

Can you populate a Listbox and not have a default item selected?(Usually I see the first item in the list automatically selected at creation).

View 5 Replies

Make A Selection Using Combo Box?

Apr 15, 2012

I have a problem to make a selection by using combo box(cbChoice). if I have 2 item [name], [age], [id_number]. After click SEARCH button, the data from database will display to textbox. this my code but its not work

myCommand = New MySqlCommand("SELECT * FROM daftarpelajar WHERE " & cbChoice.Text & " Like '%" & txtSearch.Text & "%' ORDER by id_pelajar ", conn)

[code].....

View 1 Replies

Multiple Combo Box Selection

Jan 7, 2010

I'm new to VB.NET and looking for some help with combo boxes. I was wondering if it is possible to link 2 combo boxes to each other based on user selection? [code]If the user selects Dept Name "Bakery" from the first combo box the second combo box should fill with the appropriate Section Name i.e. "Bread", "Cakes" etc.I am using VS2008 and the DB is SQL Server 2008. Both combo boxes are currently bound to the above Tables and displaying all Dept and Section Names.

View 2 Replies

.net - Populate Textbox From SQL Query After Selection At Dropdownlist

Dec 31, 2011

May i have a working sample on how to retrieve records from a DB & populate the relevant textboxes after a selection at a dropdownlist. What i have is definitely not working & im working on VS 2008. Can anyone show me the way?

[Code]...

View 1 Replies

Populate A Combobox Using Selection In Another From Excel Sheet?

Jan 30, 2012

I need to populate a combobox using the selected value in another combo. The coding that i use doesn't produce the required output. i have an excel sheet with columns called "BaseStation" & "SectorID". Combobox2 must display the related sector id with respect to the selected BaseStation[code]...

View 1 Replies

Combo Box With [None] Or Blank At The Top Of The Selection List?

Jul 8, 2011

The combobox is bound via binding source to a table. How can I display the list of look up options while having the first option say [None} and if selected, clears the value from the list.

View 2 Replies

Filter Datagridview From Combo Box Selection?

Oct 4, 2011

I'm trying to select a company name from a data bound combo box, then display the relevant record in a data bound datagridview.

I've currently used the Data Sources wizard to set the connection string, create the dataset and dragged the combo box and datagridview onto my form.[code]...

View 3 Replies

Forms :: Combo Box Change In Selection

Sep 27, 2010

ok, got a question here, two really. first i'll ask the hard one, as i think i have my other one out of the way so i'll save it for later but i made a program where a user enters in dimensions in several text boxes in inches. there are radio boxes that the user decides what thickness of wood they would like to use. what i'd like to do is add metric into the program and use two combo boxes. one combo box drops down and you can select inches, centimeters, or millimeters. the other one drops down to choose the thickness of the wood.ok now here's my question. say i pick inches in the first combo box, i'd like the second one to display only the thickness of the wood in inches, no metric. if i pick centimeters, i'd like the second combo box to display the thickness of the wood in only centimeters, no millimeters or inches. and the same goes for millimeters.i also have the program on a timer that runs at 100 milliseconds so the user can quickly see the differences in dimensions they put in instead of having to hit the calculate button over and over and over (not sure if that really matters or not, had a couple issues with the boxes earlier but don't think it was timer related now)but is this possible? basically just looking for the kinds of drop boxes that you see on a page like autotrader.com where you select dodge, and then only the dodge cars are listed, select chevy and the chevy cars are listed, etc.

View 7 Replies

Calculating Based On The Selection?

Mar 4, 2012

I have a listbox with two values, Current account and Deposit account.The current account has an interest rate of 7% and the deposit account 3%.I have 4 other textboxes. The boxes on the right is where the user inputs and the left side holds the value.

Account Type [ ] Listbox >>[Current account]
Deposit account
Investment Amount [ ] [ ]
Interest over a year [ ]

What I want for the Investment Amount is that if the user selects Current account, the amount invested will be automatically calculated with the 7% interest and the same for the deposit, calculation with 3% interest.And the Interest over a year textbox to show how much the interest will be over that year at the rate (whether its 7 or 3%)

View 7 Replies

Populate Dynamic Comboboxes Related To Each Others Selection Item?

Sep 18, 2011

I have four comboboxes in my Ist form related to course as.c_type,c_stream,c_major,c_nature.......combobox c_type contains the type of courses like degree,diploma, PG etc,similarly "c_stream" contains stream like engg,medical etc. further c_major contains all courses like computer engg(CE),mechnical(ME), physiotherapy etc. and last c_nature has course nature whether regular or private or distance.Now situation is when i select diploma from c_type, corresponding options must be populate in c_stream like engg. And now when i select engg., CE or ME must be there in c_major combobox .Same is for C_nature.The all 4 combobox must show "please select" text on form load event..i also have 2nd form where i have same combobxs. so is there any way to call the same code without again writing that to 2nd form.

View 1 Replies

Can't Populate Combo Box

Apr 20, 2010

I have tested the code for the DataSet and DataAdaptor and both work fine, and as test was able to place the MaxRows variable into one of the text boxes on my form so I know thats all ok. But I am now trying to use the function below to copy the 1st cell of each row into a combo box to populate the options and comes up with a null exception error but cant get my head around it.

[Code]...

View 1 Replies

Populate Combo Box With Xml?

Oct 23, 2011

I'm trying to populate a combo box with some data from a xml document, but so far all i'm getting is this error message in the combo box[code]...

View 2 Replies

Display Data Related To A Combo Box Selection?

Apr 4, 2009

lets see if I can explain my self. I have 2 fields in the country the country table "CountryName & Countrycoed" . My question is how to display the Contrycoed in a textbox after selecting the country in a combobox. For example if I select Canada in the combo I would like CND to be displayed in the textbox. This is the SQL I have to load the combobox

comType.CommandText = String.Format("select CountryName,Countrycoed from Country ")

View 8 Replies

VS 2008 Fill ListBox From Combo Selection

Apr 23, 2009

As the title suggests I have a ComboBox and 2 listBoxes on a form. I need to fill the left ListBox with items not now asssociated with the ComboBox selection and the ListBox on the right with items already associated with the ComboBox selection. Is it possible to populate the ComboBox and each ListBox using only one query and returning a dataset of ALL the data to do so, or do I need to Populate the ComboBox, then use 2 queries, one for each ListBox?

View 6 Replies

How To Generate ID Based On Comboboxes Selection

Jun 18, 2012

i am creating a programme for my institute which helps in their administrative process. i am using visual studio(basic) 2010. which is connected with ms access database (abcdata.accdb) the database is having table called session with columns sessionID,sessioncode,sessionname.

* sessionID data = 1,2,3,4
* sessioncode data = 13,14,15,16
* sessionname data = 2013,2014,2015,2016

[Code].....

other then this u can see i want this because i am trying to create a database which must save the students data year wise, so that whenever we need to know a detail any students then we can find with query.

View 2 Replies

Replace One Control With Another Based On Selection?

Feb 12, 2012

On my form I have two radio buttons. One for CDs and one for books. If I select CDs I have a group box that changes visible = true and I have txt boxes there I want to input. If I select books I want the groupbox to remain visible = false and in its place a text box to appear. How would I do this? I know I can just overlap the controls but that looks hideous in designer.

View 3 Replies

Selection Based On True False Value?

Jul 21, 2011

Here the code to load the records in data grid when form loads

01
Private Sub BindData()

View 1 Replies

.NET Link A Listview Selection To A Specific Database And Populate Textboxes?

Aug 19, 2010

Working on a project that contains a listView (populated from a database already) and several textboxes. What I am trying to do, and cannot figure out, is to program this so that when a user makes a selection in the listview, it hits a specific database, and based on certain values within that databse, the textboxes are populated with things such as name and address, etc..

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved