Results 1 to 15 of 15
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Unhappy Novice - ComboBox - from a table of multi values.

    Hi,



    I have a problem and could gratefully use some help.

    I have a combo box on a form that drops down to show the name of the shows but not the two performers that I have assigned to it - it just shows their individual ID keys instead of their names. If I edit the lookup query for that combo box the query its self runs fine but when I go back to the form and use the combo box I get two results of the two shows (I think because I've added the names to the query). I'd like to get the names to show up instead of their ID keys in the combo box drop down.

    I've supplied a couple of images.

    Click image for larger version. 

Name:	Screen Shot 2013-07-21 at 7.19.28 AM.png 
Views:	8 
Size:	17.7 KB 
ID:	13133Click image for larger version. 

Name:	Screen Shot 2013-07-21 at 7.20.00 AM.png 
Views:	7 
Size:	42.8 KB 
ID:	13134

  2. #2
    alansidman's Avatar
    alansidman is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,529
    Please post your SQL statement for your query. You probably need to add the table that the combo box relies on to your query.

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by alansidman View Post
    Please post your SQL statement for your query. You probably need to add the table that the combo box relies on to your query.
    Hi alansidman, - I'm making the form directly from a table into a form - but there is the statement.

    Click image for larger version. 

Name:	Screen Shot 2013-07-21 at 11.28.26 AM.png 
Views:	7 
Size:	24.5 KB 
ID:	13136Click image for larger version. 

Name:	Screen Shot 2013-07-21 at 11.30.00 AM.png 
Views:	7 
Size:	16.4 KB 
ID:	13137

  4. #4
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    If I add any column in the table (SQL) like say FullName (a calculated column that calculates the first and surname for viewing purposes) I get two results of the same show when I would rather just one result and the two performers names listed by each other like their number IDs are...

    Click image for larger version. 

Name:	Screen Shot 2013-07-21 at 12.01.46 PM.png 
Views:	6 
Size:	17.7 KB 
ID:	13138

  5. #5
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    You could say I just want to have the ID show once not twice in the query Click image for larger version. 

Name:	Screen Shot 2013-07-21 at 12.08.11 PM.png 
Views:	23 
Size:	12.4 KB 
ID:	13139

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Combining values from related records to a single field requires VBA. Review: http://allenbrowne.com/func-concat.html
    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.

  7. #7
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Really? It's a multivaule field I am displaying and it shows me already the IDs combined without the code - all I would prefer is to show the names rather than the ids
    My Shows table has no trouble when pulling the information directly..
    Click image for larger version. 

Name:	Screen Shot 2013-07-21 at 12.28.17 PM.png 
Views:	6 
Size:	15.0 KB 
ID:	13140

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Oh, sorry, I don't use multi-value fields. I don't think multi-value field will allow that in query that simply joins the two tables as done in the combobox RowSource, although I am surprised that the combobox list reflects both names, as if the multi-value field is automatically expanded. To get the associated names might have to expand the multi-value field by query then join that expanded query to the Performers table then use the VBA code.

    Review:
    http://office.microsoft.com/en-us/ac...33722.aspx#BM5
    http://office.microsoft.com/en-us/ac...010149297.aspx
    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.

  9. #9
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Used a junction box instead - problem solved in a way...

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    What is a 'junction' box?
    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.

  11. #11
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    What is a 'junction' box?
    Well not a box, a table, but made to do this...

    Click image for larger version. 

Name:	Screen Shot 2013-07-25 at 8.38.11 PM.png 
Views:	3 
Size:	20.1 KB 
ID:	13207

  12. #12
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    Yes, a junction table is appropriate for many-to-many relationship. Use form/subform arrangement for data entry.
    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.

  13. #13
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    Yes, a junction table is appropriate for many-to-many relationship. Use form/subform arrangement for data entry.
    Just out of interest, I use the junction table to "apply" the performers to the many shows they do - how would I in the subform do the same thing? I'd like to simply add the performers to the show from the show form rather than using the junction table form....

    I'm guessing a continuous form?

  14. #14
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Ah answered my own question - works too

    Now I just want to figure out how to refresh another subform on the list that simply lists the names as links (works, just doesn't refresh when I add a performer in the other list).

    Thanks for your suggestions - really helps makes things works better

    What I am trying to do next is refresh the subform on the left... hopefully by macro...

    Click image for larger version. 

Name:	Capture.JPG 
Views:	3 
Size:	37.2 KB 
ID:	13213Click image for larger version. 

Name:	Capture2.JPG 
Views:	3 
Size:	23.4 KB 
ID:	13214

  15. #15
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You are adding a performer to what - associating existing performer with a show in the junction table or are you adding a new performer to the performers table? What is the left subform for?

    Try Requery or Refresh action. Both are available in macros.
    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. Combobox setting other combobox values problem
    By maxmaggot in forum Programming
    Replies: 8
    Last Post: 06-30-2013, 07:18 AM
  2. Replies: 2
    Last Post: 02-13-2013, 09:45 AM
  3. Replies: 6
    Last Post: 09-10-2012, 07:19 AM
  4. Replies: 4
    Last Post: 12-03-2010, 04:05 PM
  5. Multi value field - Combobox help
    By stougch in forum Forms
    Replies: 0
    Last Post: 10-19-2009, 10:47 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