Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2005
    Posts
    18

    Unanswered: Listbox help! Copy from one listbox to another???

    I have a form with 2 listboxes.

    The first listbox displays all the authors in my database.
    The second listbox shows which authors have written which books.

    I want to have a command button which will ADD authors from the first list box to the second list box. (So I can show which authors have written which book).

  2. #2
    Join Date
    Aug 2004
    Posts
    43
    sorry... can you be more clear. I don't understand what your second list displays or what (exactly) you want the command button to do.

  3. #3
    Join Date
    Jan 2005
    Posts
    18
    Sorry I thought I was clear!

    I have 2 tables on my database,Books and Authors. An author can write more than one book so I need to be able to add authors to books.


    The first listbox shows all the authors of books in my database -

    Author_name (primary Key)
    Author_firstname
    Author_lastname

    The second list box will show which authors have written which books after I click an add button -

    Book_code
    book_title
    author_name

    I want to be able to add author_name to the books in the library. I want a command button to copy a selected row from listbox1 (authors) to listbox2 (books).

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi newtoaccess1,

    In the Books table try placing the AuthorID PrimaryKey in that table. Oooops, back this baby up a sec. You are using Author_Name as the primary key? What if you happen to have two authors with the same names? Set up a unique identifier, either an AutoNumber as AuthorID or create one of your own that makes each Author unique and be sure to set it to Indexed / No Duplicates. Your relationships are set up as One-To-Many correct?? One question, why are you needing a CommandButton to add the Author into the table?

    have a nice one,
    BUD

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Wow, these late hours are getting to me. I missed something else too. You have Author_Name as the PrimaryKey field. You have Author_FirstName and Author_LastName. So WHAT exactly goes in the Author_Name key field???

    just wondering,
    niters BUD

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •