graduation project and I really need help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ummaria
    New Member
    • Mar 2007
    • 16

    graduation project and I really need help

    Hello

    I have a drop down list that retrieves data from a data base.
    Under that I have a textbox that I want to retrieve information also from the database depending on the previously selected item.

    For example, if i select "Computer" from the dropdown list, the textbox should display "PC".

    This is part of my graduation project and I really need help.
    Thanks
  • vijaydiwakar
    Contributor
    • Feb 2007
    • 579

    #2
    Originally posted by ummaria
    Hello

    I have a drop down list that retrieves data from a data base.
    Under that I have a textbox that I want to retrieve information also from the database depending on the previously selected item.

    For example, if i select "Computer" from the dropdown list, the textbox should display "PC".

    This is part of my graduation project and I really need help.
    Thanks
    So.......
    Where is the problem........ .?
    just fire one qry which will retrive related data from db wrt id stored in combobox

    Comment

    • ummaria
      New Member
      • Mar 2007
      • 16

      #3
      Originally posted by vijaydiwakar
      So.......
      Where is the problem........ .?
      just fire one qry which will retrive related data from db wrt id stored in combobox
      I did that, but I dont seem to get the write code on the event handler for the combobox

      Comment

      • cmrhema
        Contributor
        • Jan 2007
        • 375

        #4
        Originally posted by ummaria
        I did that, but I dont seem to get the write code on the event handler for the combobox
        Write down the code in the combo click event or combo keyup event
        MyRs.Open "select id from details where name=" & Trim(Combo1.Tex t), MyCon, adOpenDynamic, adLockOptimisti c
        Text1.Text = Trim(MyRs("id") )
        MyRs.Close

        I presume you are using ADO connection
        Here Myrs is the recordset, Mycon is the connection
        details is the name of the table
        name is the field which will be populated in your combobox which contains computer etc
        id is the field which should be retrieved which contains PC etc
        Change accordingly to your respective field and see whether you succeed. Next time onwards kindly put on the code.

        Comment

        Working...