Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: In Vb-6, more than 1 field in a popup of combo box  (Read 2064 times)

0 Members and 1 Guest are viewing this topic.

lohani

    Topic Starter


    Rookie

    In Vb-6, more than 1 field in a popup of combo box
    « on: March 02, 2010, 09:56:19 PM »
    Sir,
    In my VB-6 project, There are 4 fields in a  table like below.
    ___________________________________
    Class   | subject |      Author     |    Price       |
    ---------|-----------|-----------------|---------------|
      I        |  Maths  |    AAA            |       25.50  |
    --------------------------------------------------------
      II       |  Maths  |    BBB            |       52.37  |
    --------------------------------------------------------
      III      |  Maths  |    CCC            |      75.99  |
    --------------------------------------------------------
    I linked this table to a combo box in VB-6, It shows only one field of this table.  I want that combo box should show all these field so that when I feed data, I may know exact information that who is author and what is its price etc and when I click on any of it, only one field should appear in combo box after close of its popup.

    I tried to join fields by using + and trim function for integer fields like  "maths" +  "|" + "author" +  "|" + trim("price").  This syntax shows all joined fields in popup of combo box but when I select  one of them, the entire line (joined) appears while I want only one of them to appear in combo box

    This syntax of joining fields is working fine in FoxPro as I want above. All joined fields are shown in popup while only one filed appears in get field after selection of required field.
    Is it possible in VB-6 ? If Yes, Please help me. 

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: In Vb-6, more than 1 field in a popup of combo box
    « Reply #1 on: March 02, 2010, 10:14:33 PM »
    Quote
    the entire line (joined) appears while I want only one of them to appear in combo box

    If you only want one of them, handle the Change() Event and change the Text property if the combo box to reflect the selected field.
    I was trying to dereference Null Pointers before it was cool.