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. Setting value of Combo...People with more white brain cells suggested to view this,,,,

Setting value of Combo...People with more white brain cells suggested to view this,,,,

Scheduled Pinned Locked Moved Visual Basic
databasehelp
4 Posts 2 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.
  • H Offline
    H Offline
    Het2109
    wrote on last edited by
    #1

    I have filled Combobox value by setting DataSource property, giving Display Member and Value Member, for a particular Table fields in Access-2000 database. I selectd some value of combobox. now when i load that form again, i want to set the previously selected value of combobox. have tried using combobox1selectedvalue = code, also tried out by setting combobox1.text, combobox1.selectedtext, but none of them is working. Its very important will be thankful and grateful if anyone can pull me out of this problem. Thanx :)Be Humble in Victory and Strong in Defeat.:) -Het

    R 1 Reply Last reply
    0
    • H Het2109

      I have filled Combobox value by setting DataSource property, giving Display Member and Value Member, for a particular Table fields in Access-2000 database. I selectd some value of combobox. now when i load that form again, i want to set the previously selected value of combobox. have tried using combobox1selectedvalue = code, also tried out by setting combobox1.text, combobox1.selectedtext, but none of them is working. Its very important will be thankful and grateful if anyone can pull me out of this problem. Thanx :)Be Humble in Victory and Strong in Defeat.:) -Het

      R Offline
      R Offline
      RichardGrimmer
      wrote on last edited by
      #2

      How about combo1.listindex = lSomeVal. Would that fit the bill "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

      H 1 Reply Last reply
      0
      • R RichardGrimmer

        How about combo1.listindex = lSomeVal. Would that fit the bill "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

        H Offline
        H Offline
        Het2109
        wrote on last edited by
        #3

        No its not working pal :)Be Humble in Victory and Strong in Defeat.:) -Het

        R 1 Reply Last reply
        0
        • H Het2109

          No its not working pal :)Be Humble in Victory and Strong in Defeat.:) -Het

          R Offline
          R Offline
          RichardGrimmer
          wrote on last edited by
          #4

          I use the code below to do what (I think) you need to do... 'Now set the combo to show the propDB stored in the .ini file For i = 0 To cmbPropDB.ListCount If cmbPropDB.List(i) = gstrPropDB Then cmbPropDB.ListIndex = i Exit For End If Next i The thing that might be causing it to work on my machine and not on yours is because I've set my combo box type to DropDownList - this means that the user can't type directly into the edit area, but must select from the list. Let me know a bit more info, and will see if can sort it out for you if you like... "Now I guess I'll sit back and watch people misinterpret what I just said......" Christian Graus At The Soapbox

          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