Results 1 to 4 of 4
  1. #1
    yosik20 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2011
    Location
    madagascar
    Posts
    5

    Adding new Record issue


    Simple question regarding one to many relationship form:

    1. I have main form, lets say 'authors', and another form, lets say 'books'. The relationship is one-to-many (many books for one author – connected by author id).


    2. From the Authors Form, For each Author record, I put a Command Button. clicking the Button at a specific Author opens the books Form - List of the books for the specific Author I clicked (I connected them using the Access Macro Wizard which Generated Macro opening the books Form with the author key arguments.

    So far I had it well.

    3. the problem is when I'm in the books Form, and I want to add new record with new book details, I would like Access to automatically paste the current Author ID from the Form (which is connecting key) to the new record

    Any suggestions?

  2. #2
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    I'm not sure I'm following you, but you could set the default for authorId to referenct the form and field you want.

  3. #3
    yosik20 is offline Novice
    Windows XP Access 2007
    Join Date
    Apr 2011
    Location
    madagascar
    Posts
    5
    OK thanks.
    1. At What event should I integrate the code? BeforeInsert? OnLoad?

    2. This is a Tabular Form with many Books records. In such a tabular form, with numerous recordes, how do access know that what AuthorID field I mean? there such field in every record

  4. #4
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    I'm not sure I can help you without seeing a sample of your database...can you post it? My visualization powers are a little weak this morning...

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

Similar Threads

  1. Adding a record not found in another table.
    By Buakaw in forum Queries
    Replies: 1
    Last Post: 03-03-2011, 05:38 AM
  2. Replies: 3
    Last Post: 10-28-2010, 07:02 AM
  3. Re: Adding a new record to a joined table
    By Mcdodre in forum Access
    Replies: 4
    Last Post: 06-30-2010, 12:07 PM
  4. Adding a record based on combo
    By cjamps in forum Forms
    Replies: 1
    Last Post: 02-24-2009, 12:01 PM
  5. Adding a single record
    By kfoyil in forum Forms
    Replies: 2
    Last Post: 11-22-2006, 09:12 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