Choose A Value Dynamically From ComboBox Depending Of The Values Selected Previously In Two ComboBoxes?
Mar 29, 2010
I want to choose a value dynamically from comboBox depending of the values selected previously in two comboBoxes.the code that loads the comboBoxes:
Private Sub LightClassComboBox_DropDown(ByVal sender As Object, ByVal e As System.EventArgs) Handles AreaClasificationComboBox.DropDown
TrafficDensityComboBox.DropDown,.....
[code]....
The problem is that in the last Sub in the If sentence gives an error of: Null Reference Exception, because the compiler thinks that in that event the data are not loaded, although the data are loaded when loadcomboBoxes sub is executed.
View 1 Replies
ADVERTISEMENT
Aug 19, 2009
How to fill another combobox depending on the value selected from first combobox?
View 2 Replies
Jun 24, 2009
I have filled a DVG with information and added another column to index(8) pragmatically Now i want to create a combobox with values depending on values in other cells on the same row so each row will have a combo box with different selections. below i have placed the code and hoped someone would have some input on how to approach this. i have tried datagridviewcolumn but that fills every row with the same information regaurdless of a if statement
[Code]...
View 15 Replies
Jun 10, 2008
Once again I have hit a brick wall here. I have a combobox in which the user types the server name and then clicks on button 'CONNECT' to populate the next combobox which contains all the databases in that
server. Then after the user selects a database, I have another button that he/she click and I want to retrieve file groups from a specific table. At this point when he/she clicks on that button I get an error: "An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"
[Code]...
View 1 Replies
Dec 23, 2009
I have a problem with a combobox. I have a form (with information about clients) with textboxes binded to a dataview. One of the columns in the dataview contains a number that tells me what kind of client it is. I don't my users want that my users have to fill in a number in a textbox, but I want them to choose a item from a combobox. De selected value should be the value that is actually saved in the database.
This is my
Dim cmd As New SqlCommand
Dim dr As SqlDataReader
VerbindingMaken()
cmd.Connection = cnnVraagbaak
cmd.CommandType = CommandType.StoredProcedure
[Code] .....
De Datasource is the information in my combobox. With Databindings I'm trying to bind it to my dataset (or view, that doesn't work either) with clients. Every time I get a NullReferenceExeption. The moment I remove the line cbo.DataSource = dsRelatie.Tables("Relatiesoort"), I don't get an error, but it doesn't work either.
That dataset is filled (I've checked) and also the derived view. The column Relatiesoort exists. What do I have to do to make it possible for my users to choose an item from a combobox and save the selected value to the underlying dataset?
View 1 Replies
Jun 6, 2011
I have a form with a ComboBox, two labels named "Price" and 'Dealer Cost" respectively a NumericUpDown control and two buttons named "calculate Commission" and "Enter Another product" respectively.I want to be able to retrieve the corresponding Price and Dealer Cost from the local database and display them next to the labels when a product is selected from the ComboBox.[code]...
View 1 Replies
Jun 30, 2010
How do I get the other values of the selected item of the combobox so that I can save it to my table? This in my function
Using cmdTeachers As New SqlCommand("SELECT TeacherID, Teacher, Dept " & _
"FROM tblTeacherFile " & _
"WHERE Dept = 'HS' ", cnn)
And I have this on formload
Me.TeacherBindingSource.DataSource = Me.GetTeachers()
Me.TeachCombo.DisplayMember = "Teacher"
Me.TeachCombo.ValueMember = "Teacher"
Me.TeachCombo.DataSource = Me.TeacherBindingSource
View 18 Replies
Jun 15, 2010
I have a web page that I need to log in, the first page is not a problem I can log in as it only has the company name to enter, but from here is where I have problems, as when the first page is done, I am directed to a second page with two fields that has to be filled, filename and author, then depending on the action you have to click on in button,out,button delay button, here is where I need help, how do I fill the second page fields and how to chose the right button depending the action to take.
View 9 Replies
Apr 26, 2012
Here's the issue in a nutshell (I can elaborate if you feel it's needed). In a DataGridView I want to capture the value of the row's key column so that when the user clicks on a column header to sort the data, I can reposition to the row that was selected prior to the click. The problem is that the sorting itself, once it's done, fires the same events (RowEnter for example) that I used to determine my key value, so it sets my variable to a new value and now
View 7 Replies
Apr 21, 2009
I have simple columns and their respective sums. However, I exclude 1 particular value from each sum, like so [code]...
Now I need to exclude another value ("Awaiting Progression") from a second column called "PROGRESSION".
Since I already exclude value based on 1 column called CATEGORY, how do I change my =Sum(Code.ExcludeOthers(Fields!CATEGORY.Value,Fields!ACTION_PLAN_NEW.Value)) to exclude a value from the PROGRESSION column if it's = ("Awaiting Progression") ?
i.e. How do I exclude multiple values, depending on values in 2 columns in SSRS 2005?
View 1 Replies
Nov 4, 2010
I want to set a variable in a class. But I want to dynamically choose which variable to set.
[Code]...
View 1 Replies
May 8, 2012
Is it possible to replace the selected NumericUpDown controls with ComboBoxes?
I understand that not all properties can be conserved but the only properties I need are the location and the size. The workflow I have in mind is as follows:
Select certain NumericUpDowns Click replace with... and then select ComboBoxes (or any other approach) Where the NumericUpDowns were, there are now ComboBoxes of the same size
The reason I want to do this is that I have to put together a GUI with multiple tabs. Each tab page has a list of Labels with either NumericUpDowns or ControlBoxes next to it. The order of the controls changes per tab. I just want to copy the items on the first tab and paste them on the other tabs. Then per tab I only have to change certain NumericUpDowns into ComboBoxes.
View 2 Replies
Jul 18, 2007
I've got a tab control and want to dynamically add tabs depending on the output from a database. I can easily add a new tab, however I want to inherit the controls and layout from the initial tab.
View 7 Replies
Jun 19, 2012
What is the appropriate declaration such as "ValueChanged" or "Click" for a NumericUpDown that will execute the code when I press enter. I already know that setting the "AcceptButton" property of the main form to a default button will not work, especially if I want a different button to be selected depending on which control I give focus. How do I accomplish this?
PS: Is the syntax any different from Visual Basic 2010 Express than it is on Visual Studio 2012 RC (running in Visual Basic Mode)?
View 17 Replies
Feb 17, 2011
im just wondering if its possible to save the current state of a combobox,for example there are two combo boxes, i selected "3" on the 1st one and "apple" on the second one, is it possible to save that setting so that when i open my program again..i can load that settings?..
View 7 Replies
Nov 6, 2009
I'm trying to play around with combo boxes and trying to figure out how to navigate to a certain url in webbrowser1 depending on the text selected in combobox1.
VB
Imports System.Windows.Forms
Imports System.Net
Imports System.IO
[Code].....
View 3 Replies
Jun 22, 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.
Protected Sub ddlCustomers_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles ddlCustomers.SelectedIndexChanged
'Populate PSI # in txtPSI based on Customer selected
[CODE]........
View 3 Replies
Nov 15, 2011
I have achieve to populate my combobox from sql and from this combobox to populate a textbox but now I have to do something more complicated.I would like to populate a combobox from an other combobox choice. And what i mean is that I have a table with Streenames and Postcodes. What I want to do is fistly to choose the Streetname from the one combobox and the interface to appear the Postcodes to the second combobox. Secondly, the postcode combobox should appear more than one postcodes because it is probable that the same streetname maybe belongs to more than one region(postcode).
View 4 Replies
Sep 30, 2011
In my program I've got several comboboxes that all have the same comboboxitems and when the user makes a selection in one of the comboboxes the selected comboboxitem gets disabled in the other comboboxes. (i.e. If the user has selected the comboboxitem with value 'a' in combobox #1 and selected the comboboxitem with value 'b' in combobox #2 then in remaining comboboxes both the comboboxitems with values 'a' and 'b' are disabled)
View 1 Replies
Sep 23, 2011
I have a form that has three comboboxes in it, cbxStudy, cbxMethod, & cbxAnalyte. When I call the form I load a data table and use that table to fill the comboboxes. I want to assign a value to cbxStudy, then fill cbxMethod by filtering the data table using the value in cbxStudy, then fill cbxAnalyte by filtering the data table using the values in cbxStudy and cbxMethod.
This code keeps failing when the forms New constructor is called, but once the form is loaded the code works great. I indicated below where the code is failing. It's failing because Me.cbxStudy.SelectedValue is = {System.Data.DataRowView} when the constructor is called even though I set the SelectedValue myself.
Public Class frmSelectMethod
Private cv_dt As New DataTable
Private cv_strPrevValue As String
[Code]....
View 4 Replies
Apr 19, 2012
I have 8 comboBoxes and 8 identical items in each comboBox.If I select one of the items in comboBox1, how can make this item to disappear from all other comboBoxes ?
View 8 Replies
Apr 8, 2010
Is there any examples with a treeview like this [URL] /scree...tinel-smod.png is it a case of having to draw each form how you would like to then hide/show the controls depending on what is selected in tree view????
View 14 Replies
Feb 27, 2010
I have 2 comboboxes. When I choose a country in cboLand I want only the states to show in cboStaat that are associated with the country from cboLand. I tried the code below but I get all different error messages. Perhaps you can see something in my code that I missed.
[Code]...
View 3 Replies
Jan 18, 2012
I seem to be having issues with the selected index on a list box.
The list box is having various items inserted depending on the user selection. An example would be:
LiIndex = ListBox1.Items.Count
ListBox1.Items.Insert(LiIndex, "Item1")
LiIndex = ListBox1.Items.Count
ListBox1.Items.Insert(LiIndex, "AND")
[CODE]......................
This all work and displays without a problem. The issue I have is if I select the second of the two AND's. If I click the second "AND" in the list and then a button to fire a method, the selected index is always the index of the first "AND". Dim listIndex as integer = ListBox1.SelectedIndex
I can't work out why, the listbox itself will always show the second one as selected, but the action will happen against the first one.
View 2 Replies
May 27, 2010
I'm using VB 2010 and I'm trying to use combo boxes on a current project but I'm not familiar with the code. I would like to set values to certain options in the combo box.
For example, if inside the combo box I listed the options:
Dog
Cat
Bird
I want dog to be set to = 1
cat = 5
bird = 12
To go further into depth, the code probably looks something like:
If cat.selected then
pet = 1
View 2 Replies
Feb 11, 2012
I have a form with a combobox and a textbox. The combobox is used to select a username and the textbox displays the staff No. I use the following code to populate the combobox.Private Sub DeleteUser_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
[Code]...
View 3 Replies
Jul 18, 2012
i have a DB table and a form the following fields , combobox and textboxes, what i need is how to write a query to retrieve data from the table when the user select some record from combobox
View 7 Replies
Jun 6, 2012
I have a small section of a windows form that allows users to select when a customer should be called (i.e. day of the week, time and inbound or outbound)When the form is loaded I will extract the information using a dataset and bind to form controls. I want to use a combo box for call stautus - inbound or outbound - however wish to give the user the choice at runtime.My thoughts are I would need to set a static list (so the user could choose) and set the default or displayed value to the info the dataset has extracted.This code to select the index doesnt work when I am comparing the dataset result to the "Outbound" string even though I am using the ToString method.
Private Sub TestTelesalesForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Telesales_DEV004016TableAdapter1.Fill(TelesalesDataset1.Telesales_DEV004016)
Me.comboCallStatus.Items.Add("Outbound")
[code]....
View 3 Replies
Jun 3, 2012
my question is how to filter other comboboxes based in first combobox whish is having same data as all.i am using visual basic 2010 and a ms access database which is connected with code.a vb form have five comboboxes and all comboboxes are field with same data with this code:
Private Sub loadsubject()
Dim OleDBC As New OleDbCommand
Dim OleDBDR As OleDbDataReader
[code].....
View 1 Replies
Dec 8, 2011
I f I have 1 combobox then my SQL query will be:
Dim objConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source = C:DB.mdb;Jet OLEDB:Database Password=Pass1;")
Dim objdataadapter As New OleDbDataAdapter("SELECT DISTINCT LOCATION FROM Table", objConnection)
View 5 Replies