Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post
    Access 2000. This is a very basic issue that I can't get to work. I'm working on a database to keep track of books. The main table is "Books". Each book may have one or more featured characters and a character may be in more than one book so I think I have a many-to-many relationship between my Books table and my Characters table. The primary form is supposed to show all the facts about a book, one book at a time.

    I have a subform (continuous form) on that main form that contains one combobox. The combobox displays a list characters from the Characters table. The record source for the subform is the BooksCharLink table that contains 3 fields: BookID, CharID, and its own LinkID. When I display this main form the facts about a book are displayed and if I dropdown the combobox it displays a list of all the main characters. The BooksCharLink table is empty at this point. If I select a character in the combobox, it is displayed correctly.

    However, if I try to move the main form to the next Books record I get an error message: "You cannot add or change a record because a related record is required in the table 'Books'".

    Does anyone have any idea what I have done incorrectly? I have programmed this kind of situation before but it has been quite a few years and I must be forgetting something.

    Thanks,
    Bill

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Have you correctly set the Link Master Fields and Link Child Fields properties of the subform as a control on the main form? Both should be set to BookIDS as far as I can tell.

    See this post for an example of how to handle data entry for a many-to-many relationship with a main form and subform.

  3. #3
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post
    [quote name='HansV' post='790634' date='25-Aug-2009 15:47']Have you correctly set the Link Master Fields and Link Child Fields properties of the subform as a control on the main form? Both should be set to BookIDS as far as I can tell.

    See this post for an example of how to handle data entry for a many-to-many relationship with a main form and subform.[/quote]
    Thanks for the reply Hans. I hadn't received an emailed notice so luckily I decided to come see how many had read my post and I found your reply! I wonder why I didn't receive a notice?

    Anyway, I believe I do have the Master and Child Link fields set up properly but I will check that now to be sure. I have download your example from the post you referenced and I'll study that and see if that will help me solve my problem. The only difference I can recognize from the words in the other post is that I did not create a composite key. I have a separate Autonumber field as the key field.

    Thanks,
    Bill

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Have you set the notification options correctly (see Post 779292)

    If you can't solve the problem, you could post a stripped down and zipped copy of the database.
    • Make a copy of the database and work with that.
    • Remove all database objects (tables, queries, forms, reports, macros and modules) that are not relevant to the problem.
    • In the remaining table(s), remove most records - leave only the minimum number necessary to demonstrate the problem.
    • Remove or modify data of a confidential nature.
    • Perform a compact and repair (Tools/Database Utilities).
    • Make a zip file containing the database.
    • If you have difficulties getting the zip file reasonably small, save the database in Access 97 format and then zip it.
    • Attach the zip file to a reply.

  5. #5
    5 Star Lounger
    Join Date
    Jan 2002
    Location
    Midlothian, Virginia, USA
    Posts
    875
    Thanks
    0
    Thanked 2 Times in 1 Post
    I still can't find any reason for the missing email notices, unless they are just very delayed.

    I found the other problem -- the wrong name for the control source for the combobox in the subform! I noticed that when I compared my stuff to your sample.

    Thanks,
    Bill

Posting Permissions

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