Results 1 to 7 of 7
  1. #1
    dreed64997 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    4

    Want to use information from 2 tables to prevent duplicates from being enter on a form

    I have a database for my book collection that I want to keep from entering duplicate book titles by the same author. The database has a book table that holds the Book Title and other information , author table that has fields for Last name and First name and a linking table. When I enter a book on my form I would like it to check to see if another book is already there with the same author and copyright year which is in the book table and then give me the option to either enter the book or not. I would also like it to show me the book information that is already in the database if that is possible.

    I don't know if it can be done. Any help would be appreciated.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    if you key the table on these fields, you cant enter duplicates.

  3. #3
    dreed64997 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    4
    thanks for the reply. but it wont work. there can be books with the same name but different authors and vise versa.

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I think you are on the right track..
    It sounds like you have a Books table, an Authors table and a junction table that links Books and Authors (BooskAuthors). Don't know your form design, but it I would use VBA to do the checks you want.

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,740

  6. #6
    NoellaG's Avatar
    NoellaG is offline VIP
    Windows 7 Access 2010 (version 14.0)
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    1,046
    Hi, in the books table I would put an unique index on the ISBN number. there can be duplicate titles, but all books have an unique ISBN number. If you can have the same book twice, use the structure tblBooks -> tblCopies where you can have several copies of 1 book.
    The link tblBooks -> tblBooksAuthors <- tblAuthors remains unchanged.

  7. #7
    dreed64997 is offline Novice
    Windows 10 Access 2010 64bit
    Join Date
    Feb 2016
    Posts
    4
    Thanks NoellaG for the information. But even using the ISBN if a author changes publishers and that publisher reprints one or more of his books then that book would have a different ISBN. So I could still end up with duplicate book with the same name by the same author. That why I stated my question in the way that I did.

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

Similar Threads

  1. Using form to enter information into a table
    By Chris2810 in forum Forms
    Replies: 2
    Last Post: 02-14-2016, 04:29 PM
  2. Prevent Duplicates Upon Selection from Combo Box
    By xx_phenom_xx in forum Programming
    Replies: 5
    Last Post: 04-28-2015, 09:30 AM
  3. Dlookup to prevent duplicates
    By arothacker in forum Access
    Replies: 16
    Last Post: 02-12-2014, 11:40 AM
  4. Replies: 1
    Last Post: 08-17-2013, 02:35 AM
  5. How to prevent duplicates in said example
    By raymondbeckham in forum Forms
    Replies: 1
    Last Post: 04-11-2012, 03:29 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