combobox question
-
hi there, i'm currently working on a thesis and i desparatly need some help from you on comboboxes. Here's the question: i have cbRestname : combobox txtResttel : textbox txtRestLoc : textbox i have a database named Restaurants on MS Access and i have a table named Restaurants_avail where i have rest_name, Rest_loc, rest_tel and rest_type I have already connected the db to my application and have been able to populate the combobox with the rest_name field. My question is this....when i scroll during runtime through the combobox, i want the textboxes to be filled with the location field and the telephone field....how am i going to do that??? I need some code pls thank you very much for your time :) lukis
Try adding columns in virtual mode and populate combobox data when DataGridView control fires event "Cell Value Needed". You can also derive your own combobox cell and return text "Loading..." in Cell.GetValue function while the SELECT statement is running at background. When it is finished, call to InvalidateCell and populate combobox with db results.
----------------- Solo hay 10 tipos de personas, las que saben binario y las que no
-
Have you tried writing code in the Click or Change event of the combo box? You could query the database based on the combo box value and set the text boxes. Hope this helps Chandra
-
Use combo box selected event changed to fill the text boxes.
Janani
-
yes but my prob is this. i don't know the code to put in the selectedindexchanged :) i'm new to comboboxes so if you could supply me with some code it would be very helpful. thank you for your prompt response luke
What version of VB are you using? Chandra
-
What version of VB are you using? Chandra
-
What version of VB are you using? Chandra
-
Hi I am sorry, but I dont know the exact syntax in VB 2003. I think you will need to open a cursor (a record set?) from the database that corresponds to the selection in the combo box and fill in the text boxes from values in that cursor. Hope this helps Chandra
-
Hi I am sorry, but I dont know the exact syntax in VB 2003. I think you will need to open a cursor (a record set?) from the database that corresponds to the selection in the combo box and fill in the text boxes from values in that cursor. Hope this helps Chandra
-
i guess vb 2005 is almost the same. if you have any code regarding vb2005 i think i can manage to try something out luke
guys/gals, i found this on thecodeproject but it's in C#. www.codeproject.com/csharp/combobox.asp I want something exactly the same but obviously in vb.net. if you could translate it in vb then i could use my data to arrange it but at least i get an idea of how this is thanks luke
-
guys/gals, i found this on thecodeproject but it's in C#. www.codeproject.com/csharp/combobox.asp I want something exactly the same but obviously in vb.net. if you could translate it in vb then i could use my data to arrange it but at least i get an idea of how this is thanks luke
guys imagine i have this table Rest_type Rest_name Tel Location ----------- ------------ --- ---------- ala carte del pinto 2345546 Dublin pizzeria francesco's 3455667 Rome now i have a form with a combobox (cbRests), and 2 textboxes (txtType, txtTel) i have been able to include the Rest_name in the combobox but i need to fill in the textboxes with the relevant info...ex when i select del pinto from the combobox, i want the textboxes to display ala carte and 2345546....how can i do that......in code please as i have no idea on how to do that.... thank you very much...your help is very much needed here luke