IT SOLUTIONS
Your full service technology partner! 
-Collapse +Expand
VB Classic
Search VB Classic Group:

Advanced
-Collapse +Expand VB Classic Store

Prestwood eMagazine

December Edition
Subscribe now! It's Free!
Enter your email:

   ► MB LobbyVisual Basic Classic BoardVB Classic Control Usage and Developing Topic   Print This     

Combo Boxes

Combo Boxes in VB Classic Control Usage and Developing topic (part of our Visual Basic Classic group).

Quick Search: Combo Boxes  
golfnutt8
Brownstown, MI
Ok lets see if I can tell you my problem without exploding.
I want to be able to choose an Item from my combo box and then based on my choice display a label telling me the full name of the choice. The Combo box will display abrev. names like Chris instead of Christopher or Dept instead of Department.
Then I want a label to say: Dept = Department. Is this possible?
I hope I was clear
  • null
  • Christopher Lond
     Posted 20 years ago (Thread Starter)
    Comment Quote
    About golfnutt8 -Collapse +Expand
    Visit Profile
    Approved member.
    Member subscribes to this thread with a verified email.

    Post ID #5550, 3 replies
    Thread Started 3/16/2002 11:01:00 AM
    View Counter=3042
    Last Reply Posted 10/11/2002 1:35:00 AM)
    Location=Brownstown, MI  
    Joined=20 years ago   MB Posts=7  
    cheddar
    Lodi, CA
    it's very possible. Where are the long descriptions stored. Somewhere you are going to need a conversion routine. The best bet would be to store them in a table with an id the abbrv and the description. Then you store the id as the value of each item in the combo and the abbrv as the text. When an item is selected you look up the row from the id and display the results in the label.
    Eric Neff
    C#, ASP.Net, SQL Server, Oracle
     Posted 20 years ago
    Comment Quote
    About cheddar -Collapse +Expand
    Visit Profile
    Approved member.
    Member subscribes to this thread with a verified email.

    Post ID #5561 (Level 1.1)  Reply to 5550
    Thread Started 3/18/2002 11:30:00 AM
    View Counter=2
    Location=Lodi, CA  
    Joined=21 years ago   MB Posts=88  
    Most Recent Post
    RobZ
     (Inactive)
    JHB, South Africa
    See if This Works:
    1. Create a Text File Containing all Abr & Explanations
    DEPT          ;     Department
    CLS ; Clear Screen
    . ; .
    Blah ; Blah
    Then Read the pairs into an Array

    Dim prs() 
    Open sFile For Input As #99
    cnt = 0
    While Not EOF(99)
    cnt = cnt + 1
    Line Input #99, myLine
    LineArray = split(myLine,";")
    redim Preserve prs(2,cnt)
    prs(0,cnt) = lineArray(0)
    prs(1,cnt) = lineArray(1)
    Wend
    Close #1
    now you can populate the combobox from prs(0,n)
    for xx = 1 to cnt
    me.ComboBox1.AddItem prs(0,xx)
    next
    finally you can display the definition of the selected abr.
    . . . inside click event 
    for xx = 1 to ubound(prs,2)
    if me.ComboBox1.Text = prs(0,xx) then
    msgbox prs(0,xx) & " = " & prs(1,xx)
    end if
    next
    Hope this helps
     Posted 20 years ago
    Comment Quote
    About RobZ -Collapse +Expand
    Visit Profile
    Inactive member.
    Member does not subscribe to this thread.
    Email Not Verified!
    Once email is verified, we will review and approve the account.
    Web Presence Hidden.
    Once above is taken care of, full Profile content will display including back links, about me, my message, custom Profile html, social networking links, message board signature, company profile, etc.

    Post ID #7885 (Level 1.2)  Reply to 5550
    Reply Posted 10/11/2002 1:35:00 AM
    Location=JHB, South Africa  
    Joined=21 years ago   MB Posts=9  
    golfnutt8
    Brownstown, MI
    This is the solution I came up with. It may not be the correct way but it works.

    If CboProdDesc.Text = "asyf" Then
    CboProdDesc = Format("asyf", ">")
    LblProdDesc.Caption = "ASYF = Assembly Fixture"
    LblProdDesc.ForeColor = vbRed
    End If
    Christopher Lond
     Posted 20 years ago (Thread Starter)
    Comment Quote
    About golfnutt8 -Collapse +Expand
    Visit Profile
    Approved member.
    Member subscribes to this thread with a verified email.

    Post ID #5568 (Level 1.3)  Reply to 5550
    Reply Posted 3/19/2002 4:56:00 AM
    Location=Brownstown, MI  
    Joined=20 years ago   MB Posts=7  

    Revive Thread!

    Add a comment to revive this old thread and make this archived thread more useful.

    Write a Comment...
    Full Editor
    ...
    Sign in...

    If you are a member, Sign In. Or, you can Create a Free account now.


    Anonymous Post (text-only, no HTML):

    Enter your name and security key.

    Your Name:
    Security key = P163A1
    Enter key:
    Icon: A Post    Thread    Idea    Important!    Cool    Sad    No    Yes    Includes a Link...   
    Thread #5550 Counter
    3042
    Since 4/2/2008
    Go ahead!   Use Us! Call: 916-726-5675  Or visit our new sales site: 
    www.prestwood.com


    ©1995-2022 Prestwood IT Solutions.   [Security & Privacy]