Results 1 to 3 of 3
  1. #1
    cherold is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2014
    Posts
    82

    Is it possible to take fields from a database and create a pulldown with those fields concatenated?


    I know what I want to happen, but I don't know if it's possible.

    I'm creating a database for my album collection. The main table will be called Albums. There will also be a Performers database (first name, last name, band name).

    For an example name, let's say Petty, Tom, Heartbreakers.

    I know I can take that information in a report and display it as I like with the right formula, such as "Tom Petty, Heartbreakers," or "Petty, Tom - Heartbreakers." But I'm wondering if I could use a formula to populate a pulldown menu.

    What I would have done in the past is have a performer_id field in Albums and use a combo box to display the names (which would just look like Petty Tom Heartbreakers). But instead, I'd like to format the information from the table so that I have a pulldown menu that just displays an alphabetized list of name strings. So the pulldown could look like:

    Jett, Joan - Blackhearts
    Petty, Tom - Heartbreakers
    Queen
    Joplin, Janis

    If this much is possible, then there's the matter of selecting an item, since it's going to be a long list. Ideally I would be able to start typing "Petty" and jump down to the proper name, or at least tap "p" and have it go to the Ps.

    Can some or all of this be done? Thanks for your help. I hope my question is clear.

  2. #2
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    I would create a query that concatenates the fields like you want to see. like

    Select dbo.tblAlbum.ID, dbo.tblAlbum.artistname & space$(1) & dbo.tblAlbum.name from tblAlbum

    then use that query to populate a dropdown

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,625
    Certainly.

    Combobox RowSource could be like:

    SELECT ID, LastName & ", " & FirstName & " - " & BandName AS Performer FROM Albums ORDER BY LastName;

    Advise no spaces or special characters/punctuation (underscore is exception) in naming convention.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 02-23-2015, 01:08 AM
  2. Replies: 23
    Last Post: 11-06-2014, 02:27 PM
  3. combobox won't display concatenated fields
    By merlin777 in forum Forms
    Replies: 4
    Last Post: 10-25-2014, 04:36 PM
  4. Replies: 3
    Last Post: 04-09-2013, 09:32 PM
  5. Sum values in concatenated fields
    By jdrubins in forum Reports
    Replies: 4
    Last Post: 09-01-2009, 07:20 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums