Results 1 to 7 of 7
  1. #1
    Thompyt is offline Expert
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839

    Multiple Values in Field


    Hello all,
    I've been out of Access for quite some time. Am am trying to get multiple values in a field on a single row.
    For instance I want to have multiple people go to the same event at the same time, without having to make multiple rows.
    Attached Files Attached Files

  2. #2
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Have a look at this link, should give you what you need:
    http://www.accessmvp.com/thedbguy/co...itle=simplecsv
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Quote Originally Posted by Gicu View Post
    Have a look at this link, should give you what you need:
    http://www.accessmvp.com/thedbguy/co...itle=simplecsv
    Cheers,
    Vlad,
    Don't they have to be in separate records to start with, for that to work though?
    Same with Allen Browne's Concatenate function?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Yes, at least that is what I thought the OP was after as shown in the attached sample.

    Cheers,
    Attached Files Attached Files
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  5. #5
    Thompyt is offline Expert
    Windows 10 Access 2016
    Join Date
    Sep 2014
    Location
    El Paso, TX
    Posts
    839
    Thank you Vlad,
    Almost but not quite what I was looking for. My poor explanation's the culprit. What I was looking for is in the Events EVID in the Names table to reference that person going to different events. [tbl_Names].[EVID] could equal 1,3,6... or the same with the other tables. Multiple people can go to the same event on the same date. Also names can go to different events, different dates. I was trying to only change the reference ID vice having the names being repeated in [tbl_Names]. You could use the lookup tab in the table design and use a combo box and select each event as an example, but I was lead to believe that is bad form.
    Thanks
    Wayne

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Your structure is all wrong

    You should have a table that links Names to Events to Dates?

    I have a similar setup for a personal project. That links 4002 crew names, 59 ships, and 53 dates, as well as Rank, making a table to join them all being over 20,000 entries.

    However names are not duplicated, nor are ships, dates or rank.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    Gicu's Avatar
    Gicu is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jul 2015
    Location
    Kelowna, BC, Canada
    Posts
    4,114
    Wayne,
    You do not want to have an actual list for the EVID, you build that list as needed in a query (and show it in a form or report) using the approach I showed you. SO you need to move the EVID from tbl_Names as suggested by Welshgasman into a new linking table (tbl_EventNames) with three fields (EVN_ID PK AutoNumber, NID_FK Long, EVID_FK Long) and once you populate that you simply use something like this to get your list:

    Code:
    SELECT tbl_Names.NID, [LAST] & ", " & [FIRST] AS FullName, SimpleCSV("SELECT [EVID_FK] FROM tbl_EventNames WHERE NID_FK=" & [NID],",") As EventList FROM tbl_Names ORDER BY [LAST] & ", " & [FIRST];
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

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

Similar Threads

  1. Replies: 2
    Last Post: 06-12-2019, 05:57 PM
  2. Replies: 2
    Last Post: 05-17-2017, 06:17 AM
  3. Replies: 10
    Last Post: 11-18-2014, 04:25 PM
  4. Replacing many values at once in a multiple values checkbox field.
    By ConfusedDatabaseDesigner in forum Forms
    Replies: 2
    Last Post: 07-20-2012, 08:58 AM
  5. Multiple Values Field
    By cbrsix in forum Access
    Replies: 7
    Last Post: 05-14-2012, 12:12 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