Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Jennifer Murphy's Avatar
    Jennifer Murphy is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2012
    Location
    Silicon Valley
    Posts
    52

    How to get a Combobox to display multiple values?

    I am working on what I thought would be a very simple database project. I have been using ChatGPT for a range of different subjects. Some of them have some very interesting information. I wanted to create a database to keep track of what subjects are discussed in each chat.



    The database has just 2 tables and 1 junction table. I have one form and one subform for the Combobox. The Combobox is to allow more than 1 subject to be assigned to a chat. I would like the Combobox on the main form to display all of the subjects for that chat. I can't get it to display more than 1.

    Here are the relationships:

    [IMG][/IMG]

    I have the Default View of the subform set to "Continuous Forms" in the Property Sheet under the "Format" tab.

    Is there something else I need to do?

    Thanks

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,426
    Only comboboxes linked to table lookup fields will allow multi select. Table lookup fields are usually not recommended but I might use one for this case. At least I know the limitations going in if it became an issue.
    Do you really need a composite key in tblChatsSubjs? Probably what you should have is a ChatSubjsPK field instead, and the other two just foreign keys. The idea of a junction table is to allow many to many records. Having a composite key or composite index would prevent that.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742

  4. #4
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2021
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Can you post a copy of the db or at least show us the SQL Statement used for the Row Source property of the combo
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  5. #5
    Jennifer Murphy's Avatar
    Jennifer Murphy is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2012
    Location
    Silicon Valley
    Posts
    52
    Quote Originally Posted by Bob Fitz View Post
    Can you post a copy of the db or at least show us the SQL Statement used for the Row Source property of the combo
    Sure, I am happy to upload the database. How do I do that? And how can I remove any personal information first?

  6. #6
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2021
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,614
    Quote Originally Posted by Jennifer Murphy View Post
    Sure, I am happy to upload the database. How do I do that? And how can I remove any personal information first?
    Make a copy of the db.
    Delete rows from tables and enter a few imaginary records.
    See "How to Attach Files" at the very top of this thread.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  7. #7
    Jennifer Murphy's Avatar
    Jennifer Murphy is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2012
    Location
    Silicon Valley
    Posts
    52
    Quote Originally Posted by Micron View Post
    Only comboboxes linked to table lookup fields will allow multi select. Table lookup fields are usually not recommended but I might use one for this case. At least I know the limitations going in if it became an issue.
    Do you really need a composite key in tblChatsSubjs? Probably what you should have is a ChatSubjsPK field instead, and the other two just foreign keys. The idea of a junction table is to allow many to many records. Having a composite key or composite index would prevent that.
    Can you say more about your simpler solution? I will upload the database as soon as I figure out how. Then maybe you can comment. Thanks

  8. #8
    Jennifer Murphy's Avatar
    Jennifer Murphy is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2012
    Location
    Silicon Valley
    Posts
    52
    Interesting. What do you think of the comment that a junction table was overkill for this simple app?

  9. #9
    Jennifer Murphy's Avatar
    Jennifer Murphy is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2012
    Location
    Silicon Valley
    Posts
    52
    Quote Originally Posted by Bob Fitz View Post
    Make a copy of the db.
    Delete rows from tables and enter a few imaginary records.
    See "How to Attach Files" at the very top of this thread.
    There is no personal information in the database tables, I was referring to information in the file itself, such as the Author. But there doesn't seem to be any. So I probably don't need to make a copy, right?

  10. #10
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    Interesting. What do you think of the comment that a junction table was overkill for this simple app?
    I don't know where that comment was made.

  11. #11
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,426
    Can you say more about your simpler solution?
    Don't know what that is. I didn't say anything was simpler, nor did I say a junction table was overkill if you're referring to me when you posted that.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  12. #12
    Jennifer Murphy's Avatar
    Jennifer Murphy is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2012
    Location
    Silicon Valley
    Posts
    52
    Quote Originally Posted by Micron View Post
    Don't know what that is. I didn't say anything was simpler, nor did I say a junction table was overkill if you're referring to me when you posted that.
    Sorry, I guess I read something into your comment that you did not intend.

  13. #13
    Jennifer Murphy's Avatar
    Jennifer Murphy is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2012
    Location
    Silicon Valley
    Posts
    52
    Quote Originally Posted by Bob Fitz View Post
    Make a copy of the db.
    Delete rows from tables and enter a few imaginary records.
    See "How to Attach Files" at the very top of this thread.
    I followed the How to Attach Files instructions only to discover that by tiny db at 504 kb exceeds the 500 kb limit. And that is after I did a compact. Is any dc under that limit? ������

    So, I have copied the database to a OneDrive folder, which I planned to share. But, as with everything M$FT, it has been "syncing" for over 15 minutes. If it finishes in my lifetime, I will post a link.

  14. #14
    Jennifer Murphy's Avatar
    Jennifer Murphy is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2012
    Location
    Silicon Valley
    Posts
    52
    Ok, the OneDrive folder finally finished syncing. Here is a R/W link to the folder containing the db. Anyone should be able to download the db and also upload a modified/fixed version. If you do that, please use a different filename so I can keep everything straight.

    https://1drv.ms/f/s!ArBLbKVM2K_H06BM...2F-zg?e=1eySj5

    Let me know if this doesn't work. This is my first time trying this.

    Thanks

  15. #15
    davegri's Avatar
    davegri is offline Excess Access
    Windows 11 Access 2019
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,742
    Chat Log-davegri-v01.zip

    See if this is on the right track.
    It includes Not-in-List event so that you can enter new subjects without having to go a separate form to do so.
    The main form recordsource is the chat table, while the subform's recordsource is the junction table.
    You can add as many subjects as you like to a chat.

    If you want it the other way around, with subjects as the main form and chats as the subform it is easily done.
    In a few MTM situations, I've included both ways, and they co-exist easily as long as only one method is open at a time.

    Click image for larger version. 

Name:	chat.png 
Views:	20 
Size:	25.2 KB 
ID:	52062
    Last edited by davegri; 07-30-2024 at 04:38 PM. Reason: added more info

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Display of multiple field values
    By Schonrock in forum Forms
    Replies: 2
    Last Post: 02-16-2021, 04:44 PM
  2. Replies: 2
    Last Post: 04-09-2016, 01:23 PM
  3. Replies: 3
    Last Post: 03-02-2016, 06:05 PM
  4. Replies: 8
    Last Post: 03-28-2014, 12:04 AM
  5. Replies: 3
    Last Post: 12-16-2011, 02:37 PM

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