Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. combobox question

combobox question

Scheduled Pinned Locked Moved Visual Basic
databasequestionjsonhelp
13 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lukisf
    wrote on last edited by
    #1

    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

    C J O 3 Replies Last reply
    0
    • L lukisf

      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

      C Offline
      C Offline
      ChandraRam
      wrote on last edited by
      #2

      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

      L 1 Reply Last reply
      0
      • L lukisf

        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

        J Offline
        J Offline
        Janani Divya
        wrote on last edited by
        #3

        Use combo box selected event changed to fill the text boxes.

        Janani

        L 1 Reply Last reply
        0
        • L lukisf

          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

          O Offline
          O Offline
          Oskar net
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • C ChandraRam

            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

            L Offline
            L Offline
            lukisf
            wrote on last edited by
            #5

            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

            C 1 Reply Last reply
            0
            • J Janani Divya

              Use combo box selected event changed to fill the text boxes.

              Janani

              L Offline
              L Offline
              lukisf
              wrote on last edited by
              #6

              my problem is how to fill them :) i don't know the syntax luke

              1 Reply Last reply
              0
              • L lukisf

                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

                C Offline
                C Offline
                ChandraRam
                wrote on last edited by
                #7

                What version of VB are you using? Chandra

                L L 2 Replies Last reply
                0
                • C ChandraRam

                  What version of VB are you using? Chandra

                  L Offline
                  L Offline
                  lukisf
                  wrote on last edited by
                  #8

                  2003 thanks luke

                  1 Reply Last reply
                  0
                  • C ChandraRam

                    What version of VB are you using? Chandra

                    L Offline
                    L Offline
                    lukis
                    wrote on last edited by
                    #9

                    any news :) luke

                    C 1 Reply Last reply
                    0
                    • L lukis

                      any news :) luke

                      C Offline
                      C Offline
                      ChandraRam
                      wrote on last edited by
                      #10

                      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

                      L 1 Reply Last reply
                      0
                      • C ChandraRam

                        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

                        L Offline
                        L Offline
                        lukis
                        wrote on last edited by
                        #11

                        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

                        L 1 Reply Last reply
                        0
                        • L lukis

                          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

                          L Offline
                          L Offline
                          lukisf
                          wrote on last edited by
                          #12

                          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

                          L 1 Reply Last reply
                          0
                          • L lukisf

                            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

                            L Offline
                            L Offline
                            lukisf
                            wrote on last edited by
                            #13

                            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

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups