Hi, I'm trying to create cascading comboboxes, and my code isn't working. I've looked at other threads and I don't know why it isn't working properly. The first combo box displays System Names and the second combobox should populate the all Locations of that specific system chosen. When I run my application, the first combobox populates without any duplicates just as it shoud but when I select a System Name from it, the location combo box populates just one entry and doesn't allow a drop down of all the other location names. Here's my code: [CODE] '---Form_Load Dim con As …

Member Avatar
Member Avatar
+0 forum 3

Hello Everyone, Okay I have got probably one of the weirdest question you have seen in awhile. I have been working on a custom image selection form (much like a file selection, but I didn't like the default Microsoft one). This also includes me rebuilding a custom object, that references, has multiple lists, other custom object, ext, ext. Right now I have problem with it blow out of range exceptions. But here's where it gets weird ... it shouldn't be. Yeah I know, you think I am wrong. But when it blows the error I check all the code's values, …

Member Avatar
Member Avatar
+0 forum 1

I created a form with datagridview for a list of clients. Now, I want to add a Search funtionality for my list, so that the user can just type in the value he wants to see and the row with that value will get selected. Also, I want to add a combobox wherein the user can choose what kind of filter he wants to apply to the Search function (by date, by number, by name...). And I also want the search queries to be non specific and not case-sensitive (I mean if I want to look for the name 'Sarah …

Member Avatar
Member Avatar
+0 forum 2

I'm having a ComboBox in which I added items in order provide the user autocomplete for the text he's typing. I am looking for a property of ComboBoxes that could identify if the text was an item of the ComboBox or not. (I would like not to loop each time through its items). I would like do use ComboBox.Text if the item does not exist and ComboBox.SelectedItem if it does. Thanks.

Member Avatar
Member Avatar
+0 forum 4

I would like to do something like this: comboBox6.Items.AddRange(new IEnumerable<int> { Enumerable.Range(1,8).ToArray() } ); (add numbers 1 to 8 to ComboBox Items using an IEnumerable object), but i can't figure out how. Thanks.

Member Avatar
Member Avatar
+0 forum 2

I have gone through the articles appeared in this forum on the above Area.But it didn't helped me much,As I am new to VB.net. In VB6 I have the following code and it works well. Private Sub CmbBank_GotFocus() CmbBank.BackColor = vbYellow LblMsg = "Select Bank" Dim A, B, C As Integer CmbBank.Clear CmbBank.Text = "SELECT BANK NAME" Set RS = New ADODB.Recordset If RS.State = adStateOpen Then RS.Close RS.Open "SELECT * FROM Receipts", CN, adOpenStatic, adLockOptimistic If TxtMode = "A" Then Do Until RS.EOF CmbBank.AddItem RS!Bank RS.MoveNext Loop Else Do Until RS.EOF A = Len(Left(RS!Bank, 25)) A = 25 - …

Member Avatar
Member Avatar
+0 forum 16

Friends...A small problem I have a combobox in which I want to add list from a field from a ACCESS databas Table.It works well My code is here ACRS.Open "SELECT * FROM Salary1", CN, adOpenStatic, adLockOptimistic Sfm = ACRS!Month Do Until ACRS.EOF CmbSfm.AddItem ACRS!Month ACRS.MoveNext Loop My problem is , I want to populate the field Month ,But the value of Month for every 4 records will be the same.Hence the combobox list will be repeated 4 times by the value of month. I want only the first one of the four records so that the list will not contain …

Member Avatar
Member Avatar
+0 forum 11

Hi, I have a VBA script that places WinForm dropdown boxes (xlDropDown) into an excel workbook dynamically. For some reason, on the 17th box (called "INCL" & i + 1 in the code below), the data type of the placed shape becomes msoAutoShape instead of msoFormControl. All of the following controls are msoFormControl again. I've been banging my head on this one. If anyone has any ideas as to why this is happening, that would be great. The problem is that I am able to access te selection in msoFormControl, but not msoAutoShape. Thanks very much. Sub CreateFormsButton() Range("A1").Select Application.StatusBar …

Member Avatar
Member Avatar
+0 forum 9

When one sets the DropDownStyle property of a combobox control to DropDownList, the system (from windows 7 on, not sure I had this problem in Vista) changes the appearance of the field, so that it somehow reminds one of a command button. I definitely need the DropDownList behavior, but I'd like to have a free hand in setting the backcolor. I tweaked the drawmode property, but then the values are not displayed anymore. So is there a quick fix to this, or do I have to code the dropdownlist behaviour to work around this? Many thanks and happy New Year. …

Member Avatar
Member Avatar
+0 forum 1

Hi Just asking for a better solution for my approach in getting sql result with different multiple conditions based on comboboxes. I have a 4 comboboxes, for Branch, Type, Status and other info. User can select conditions from this comboboxes. The default value is "All", meaning no specific condition at all, but can choose from this cb's simultaneously. For example the user can choose specific type with all status and all other info, can also choose specific type, condition and all other info. in short he can select any combination of conditions from this cb's. I know I could query …

Member Avatar
Member Avatar
+0 forum 12

Hi, I'm a beginner in Vb.net. I have a problem like this. My table name in dtabase is *tblsales* ![67f4b407a5443c6d48ba102a4779c9f2](/attachments/large/4/67f4b407a5443c6d48ba102a4779c9f2.JPG "67f4b407a5443c6d48ba102a4779c9f2") and i have 4 combobox in month and year ![81361dad1be3d14458ae4ad0a3aa9a55](/attachments/large/4/81361dad1be3d14458ae4ad0a3aa9a55.JPG "81361dad1be3d14458ae4ad0a3aa9a55") i need to find data between this 4 combobox. And this is the code i've tried before. For a As Integer = 0 To 11 Dim b As DateTime ComboBox1.Items.Add(Format(b.AddMonths(a), "MMMM")) Next ComboBox1.SelectedIndex = 0 that one to fill the combobox with months and this code below to search the data DA = New SqlDataAdapter("select * from tblpenjualan where month >='" & ComboBox2.Text & "' And month <='" …

Member Avatar
Member Avatar
+0 forum 13

I am populating a combobox with a list of names and the list contains approximately 7600 items. Here is the code: foreach (string customerName in customerNames) { comboBoxCustName.Items.Add(customerName); } This loop takes nearly one minute to complete (58.6 seconds to be precise). I don't think it should take that long, can someone please offer some ideas as to why it's taking so long?

Member Avatar
Member Avatar
+0 forum 3

Hi, I would like to to to store the Name and Items of ComboBox into dictionary. With the below code,I am able to store them. However, Name of ComboBox is as counting ComboBox10 to ComboBox1n. I would like to store Name of ComboBox as ComboBox1,ComboBox2 rather than ComboBox10 to ComboBox1n for my futher propose. It's not working with _dic.Add(ctl.Name, myCombo.Items(j).ToString) so I have to loop as _dic.Add(ctl.Name & j.ToString, myCombo.Items(j).ToString). Would Appreciate your help and suggestion. If TypeOf ctl Is ComboBox Then myCombo = CType(ctl, ComboBox) For j As Integer = 0 To myCombo.Items.Count - 1 _dic.Add(ctl.Name & j.ToString, myCombo.Items(j).ToString) …

Member Avatar
Member Avatar
+0 forum 5

Hi I am storing name and texts of controls (Label, Button, ComboBox, ListBox, etc.) into a dictionary. With ContainsKey, I am able to find the texts of Labels, Buttons, and RadioButtons. However, I am getting problem to find the items of ComboBox. Appreciate if you have an idea. If _dic.ContainsKey(selectedControl.Name) Then Debug.Print("I found the text """ & _dic(selectedControl.Name) & """")

Member Avatar
Member Avatar
+0 forum 2

Hey Guys, What i want it to do : 1. Combobox is displayed with a list of countys ie Limerick Dublin Cork 2. Choose County brings up second Combobox with countys towns and villages. 3. Hit search brings up relevant towns and vilages from the county chosen. What it does: 1. Loads countys 2. chose county 3. Second box pops up but with no values in the combobox nd it then crashs and informs me that County_ID cannot be found and "severe null" Code to fill First Combobox with the Countys (Works fine) public Activities_Area_Search1() { try { initComponents(); JdbcRowSetImpl …

Member Avatar
Member Avatar
+0 forum 2

I have an issue within VB Express 2008 which I am struggling to resolve. I am trying to take the information from 3 columns in a CSV file (ServerRef, ServerName, ServerIP) with no header row and populate 3 combobox's for users to select from to initiate an RDP connection. So far I have gotten the following code, but I'm unable to use the information in the combobox's in other sub-routines and seem unable to move the information into a text box or dim's value field... Private Sub Testing_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim Servers = …

Member Avatar
Member Avatar
+0 forum 4

I have a form with A GroupBox on it. Within the GroupBox is a TextBox and a ComboBox. I am trying to disable one or the other when either text is entered into the textbox OR when an item has been selected in the combobox. I can get the combobox to become disabled by using the TextChanged event in the textbox control. If I select an item in the combobox control it will disable the textbox using the SelectedIndex event, however if I delete the selection manually, I cannot get the textbox to become enabled and the combobox to become …

Member Avatar
Member Avatar
+0 forum 3

Hi group! I have what I hope is a unique question: In need to populate a combo Box with the information stored in 6 different columns on one row of a data table. I know how to do this if it just one column and one row. To be specific, I have one row of data that contains 'Unit of Measure' information within 6 different column names. They are UMName, UMName2, UMName3, UMName4, UMName5 and UMName6. This data is attached to one specific part number. Would someone know how I can get the one piece of info from each one …

Member Avatar
Member Avatar
+0 forum 2

I have a combobox that is bound to a DB and works great. However, when the user adds a value to the table to which the combobox is bound, the combobox keeps the old value and adds the current items in the table. In this case the table originally held just one record ("2012"). The user added 2013 so the table now shows two records ("2012" and "2013"), but the combobox shows three records ("2012", "2012", and "2013"). UNTIL I exit the app and restart, in which case it correctly reflects the only two records in the table ("2012" and …

Member Avatar
Member Avatar
+0 forum 2

<label class='colwidth' for='selectc' >Select Courses*: </label> <form action="send.php" name="course" id="states"method="post"> <Select name="States" id="State" style="width:40px;" > <option value=></option> <option value="1">HTML 5</option> <option value="2">JQuery</option> <option value="android">American Samoa</option> <option value="flash">Flash</option> <option value="flex">Flex</option> <option value="javascript">Javascript</option> </Select> <input type='submit' name='course' value='Submit' /> </form> And my php file is this <?php //Place state array at the top of the file $states = array( 1 => "html5", 2 => "jquery", 3 => "android", 4 => "flash", 5 => "flex", 6 => "javascript" ); //Generate select box if(!is_array($states)) { echo "<select name='states' id='states' style='width:40px'>"; foreach($states as $id => $name) { echo "<option value='$id'>$name</option>"; } echo "</select>"; } //Form …

Member Avatar
Member Avatar
+0 forum 16

Hi - I am a pretty remedial visual studio express user. I recently understood how to do cascading comboboxes using the binding sources of the related tables, eg tbl 1 Make, Table 2 model, so as eg only ford models displayed in cbo2 if Ford selected in cbo1 - thanks to Beth Massi! However I'm having some trouble with the following scenario. I have a 'tblUser' table with fields: Name, Name_id, Firstname and Surname. I have a tblAsset' table with fields: 'AssetNo' and 'Description'. On form I have 4 controls: 2 x cbo and 2 x txt. Now, there is …

Member Avatar
Member Avatar
+0 forum 5

Hello to everyone, im having trouble getting the value of a combobox in HTML to php! Frist I import data from a mysql collum into the combobox, being this the value of the combobox! I want to be able to get the selected value when I submit my form. I tried using sessions but i always get the data of the last row inserted. Heres the code that I have: <?php include "connect_database.php"; $query = mysql_query("SELECT id_expense, category_name FROM expenses") or die(mysql_error()); ?> ...... <select name="expenses" > <option value="0" selected="selected"> Choose</option> <?php while($row = mysql_fetch_assoc($query)){ // $id=$row["id_expense"]; $category = $row["category_name"]; …

Member Avatar
Member Avatar
+0 forum 7

Hello I am trying to display an ID which is a primary key in my table by selecting the corresponding name in my table. the names have been saved in a combo box and depending on the name selected the textbox will display that Id. the code I have so far only gets the names from sql server but doesnt show the id in the textbox. can you guide me on this please.. this is the code for combobox. i placed it in the formload [CODE] Public Sub RtnCmbVal() Dim conn As SqlConnection Dim str As String = "select ConsultantId, …

Member Avatar
Member Avatar
+0 forum 8

Hello, I have made an Employee Time clock application. I have been working on connecting my application to a MySQL database, I have a textbox wich is used to add an employee name to my database (this is working perfectly.), but I also a combobox where I want the list of Employee names retrieved from the database (this is where my problem is.) I have looked at a few different forum posts, and I still can't seem to get it to work. With this method it won't connect to my Database, but when I take out this code out everything …

Member Avatar
Member Avatar
+0 forum 3

Hello everyone, I'm new to php and i'm developing a website for a school project. I need to implement a combobox with some options, for exemple, if I choose "Alimentation" it appears a table with the specific fields for this option and If I choose other option it appears a table with specific fields for it etc. The combobox in html has values, if I pass this values to a php variable I think I can do this system Ex html: **`<option value = "1"> Alimentation</option>`** Ex php: $option1 = the value on the combobox How can I do this? …

Member Avatar
Member Avatar
+0 forum 2

i am working on a POS as a school project. im having a problem in getting the stocks, which is a record in my database. this is what i need to do, i need to populate the combobox with drug names with suggests. when i choose a certain drug, its stocks will be displayed on a textbox as a reference. this is what ive done so far: Private Sub posform_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load accountlbl.Text = mainmenu.namelbl.Text dbconnect() Dim suggest As New SqlCommand("select prodname from productinfotbl ", connect) suggest.CommandType = CommandType.Text adapt.SelectCommand = suggest adapt.SelectCommand.ExecuteNonQuery() …

Member Avatar
Member Avatar
+0 forum 4

Not sure what I am doing wrong but let me try to explain my issue. I have a single combobox on my form that I use to load external settings. If I load, lets say, 100 settings in to this combobox then I clear the combobox via Combobox1.items.clear(), then try to reload a different set of settings that has a far less overall count, the combobox will not load the items and the dropdownlist will be massive but blank. NOW, if I load the settings that have far less then clear and load the settings with significantly more settings, then …

Member Avatar
Member Avatar
+0 forum 2

Hi, I have a custom combobox(say comboboxEX) derived from System.Windows.Forms.ComboBox. OnPaint() event I have some background color and styles for the combobox. Every thing works fine. My problem is, I can't set background color when DropDownStyle is "**DropDown**" and **Enabled = false**. But it workes when DropDownStyle is "DropDownList" and Enabled = false. How do I set background color for "DropDown" when it is in disabled state? Any help will be appreciated.

Member Avatar
Member Avatar
+0 forum 1

Can someone tell me how to add an additional item to a combobox that is bound to a datatable? I have populated the ComboBox with data from table sSQLCbo = "SELECT region.ID, region.name FROM [STORES] ORDER BY store.ID" Dim ds As New DataSet da = New OleDb.OleDbDataAdapter(sSQLCbo, con) da.Fill(dt) con.Close() ComboBox1.DisplayMember = "Region" ComboBox1.ValueMember = "id" ComboBox1.DataSource = dt Now I want to add an additional item "All Regions" so I can use this as part of a future query using the ComboBox SelectedIndexChanged.

Member Avatar
Member Avatar
+0 forum 3

Hey i would like to know how i can use a combobox to show alternatives which i will choose from but with more information when i choose like if a combobox has theese options Klas Maria Mat i choose Mat and the selected index is Mat now i want it something like this male - Klas - group1 female - Maria - group2 male - Mat - group1 i choose Maria and the selected index is Maria so i dont have to cut the string up and divide and stuff can you use some kind of listview? how? Thank you …

Member Avatar
Member Avatar
+0 forum 23

The End.