Results 1 to 5 of 5
  1. #1
    MichaelA is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2019
    Location
    Wisconsin
    Posts
    139

    Two combo boxes in form whose control source and row source are the same


    I'm working on a Library database and many of the books have co-authors. In my "Books" form, I need two combo boxes that both get their information from the "Authors" table and the form writes Title, Author, CoAuthor (If there is one) and Location to the "Books" table. The problem is, when I select an author in one combo box, it fills in the second combo box with the same author. When I select another author in the second combo box, the first combo box copies. How can I set up the two combo boxes so I can select two different authors from the same table and have them written to the "Books" table, one as "Author" and one as "CoAuthor"

    Thank you!

  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
    You simply bind the first one to the Author field and the second one to the CoAuthor one. So in your Books table you have two fields (Author - short text or AuthorID - long and CoAuthor or CoAuthorID) and the two combo boxes would have their row sources "SELECT AuthorID, Author FROM AUTHORS ORDER BY Author;" with Column Count=2 and Column Widths 0";3".
    Cheers,
    Vlad Cucinschi
    MS Access Developer
    http://forestbyte.com/

  3. #3
    MichaelA is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2019
    Location
    Wisconsin
    Posts
    139
    Quote Originally Posted by Gicu View Post
    You simply bind the first one to the Author field and the second one to the CoAuthor one. So in your Books table you have two fields (Author - short text or AuthorID - long and CoAuthor or CoAuthorID) and the two combo boxes would have their row sources "SELECT AuthorID, Author FROM AUTHORS ORDER BY Author;" with Column Count=2 and Column Widths 0";3".
    Cheers,
    I'm not sure I understand. How does that draw from the "Authors" table.

    Sorry, I'm a newb.

  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
    The row source (that populates the combo) is from the Authors
    SELECT AuthorID, Author FROM AUTHORS ORDER BY Author;
    , but you store the IDs (or author's name) in two fields in the Books table.

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

  5. #5
    MichaelA is offline Competent Performer
    Windows 10 Access 2013 64bit
    Join Date
    Sep 2019
    Location
    Wisconsin
    Posts
    139
    Quote Originally Posted by Gicu View Post
    The row source (that populates the combo) is from the Authors , but you store the IDs (or author's name) in two fields in the Books table.

    Cheers,
    Thank you! That did it. I appreciate your help!

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

Similar Threads

  1. Replies: 19
    Last Post: 06-26-2018, 07:13 AM
  2. Replies: 3
    Last Post: 04-27-2016, 01:25 PM
  3. Replies: 2
    Last Post: 10-03-2014, 10:07 AM
  4. Replies: 5
    Last Post: 09-18-2013, 09:15 PM
  5. Replies: 7
    Last Post: 10-28-2012, 02:55 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