Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5976545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:14:39+00:00 2026-05-22T21:14:39+00:00

I’m have a query that returns the following columns: Code LastName FirstName I have

  • 0

I’m have a query that returns the following columns:

Code
LastName
FirstName

I have a combobox where all of this info is displayed in the dropdown. But when I select a row, all I see in the combobox is the Code (its an employee number). What I’d like to do is display:

“[Code] – [LastName], [FirstName]”

as the selected item when a value is selected, and still store just the [Code] in the combobox’s .Value property.

How is this done? I’m used to C#.NET where a dropdown has 2 properties (displayValue and selectedValue).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:14:40+00:00Added an answer on May 22, 2026 at 9:14 pm

    1. In this method you won’t be able to have the formatting (dash or comma):

    Set the column count to 3.
    Set the Bound column to 1 (it’s one-based, even though the .Column property is zero-based).
    Adjust column widths to a pleasing arrangement.
    Set RowSourceType to “Table/Query”.
    Set RowSource to your query.
    Do not set a Control Source (leave blank–this leaves the .Value unbound from underlying data).

    You can do all the above in Design View.

    2. This method is more work, but gets exactly what you asked for:

    In Design View:
    Set column count to 2.
    Set Bound Column to 1,
    SetColumn Widths to 0";2" (accepts inches or cm, and if you just enter undecorated numbers will read them as inches (or as set in Options(?))).
    Set RowSourceType to “Value List”.
    Do not set a Control Source (leave blank–this leaves the .Value unbound from underlying data).

    Write this code:

    Private Sub Form_Load()
    
    'declare variables & open query as recordset--left as exercise
    
        With Combo1
            .Clear
            Do Until rs.EOF
                .AddItem rs.Code & ";" & rs!Code & " - " & rs!LastName & ", " & rs!FirstName
                rs.MoveNext
            Loop
        End With
    
        'close rs & clean up--another exercise
    
    End Sub
    

    The semicolon between the rs!Code instances in the string concatenation is what points them into the appropriate columns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I have a text area in my form which accepts all possible characters from
I have some data like this: 1 2 3 4 5 9 2 6
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.