Results 1 to 3 of 3
  1. #1
    Bradex is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    101

    Exclamation Able to add record in table but not in form


    I have a tabbed form which enters data into 3 tables:

    Table A: Person name and other details
    Table B: Additional details of the person
    Table C: Details of a specific event regarding the person which occurs daily so that each person has many ‘daily data IDs’

    Table A has one-to-one relationship with Table B and one-to-many relationship with Table C.

    After creating, the tables, I created the relationships with option 1 (Only include rows where the joined fields from both tables are equal) in join type. Enforce referential data integrity, cascade updating and deletion are ticked.

    Then I created a tabbed form,
    Page 1: Controls from Table A
    Page 2: Controls from Table B
    Page 3: Table C displayed as a sub-form
    The Primary key is placed outside the tabbed form so that, I can know which record I am viewing regardless of the page I am on.

    Now, I find that, the form displays the already existing records perfectly, but it is not allowing me to add new records. At the same time, I am able to add records from the table. I strongly feel that this has something to do with relationships.

    Can somebody point out what I am doing wrong here. Thanks!

    PS: One thing which I can make out is that Table A and B need not be separate. But still, I wish to know what error is occurring.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    rule is one form, one table. related tables should be in subforms using the linkchild and linkmaster subform properties to create the relationship. If you have set up your relationships as one to many, these will be populated automatically

    It is sometime possible to have more than one table in a form recordsource and make it updateable by changing the recordset type to dynaset - inconsistent updates, but you will need to ensure that if a new child record is created that that the relevant foreign key pointing back to the parent table is populated.

  3. #3
    Bradex is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Sep 2011
    Posts
    101
    You are right! ONE FORM ONE TABLE!

    I combined table 1 and 2.
    Then, I recreated the form and populated the fields from this new table. I added controls from table 3 as a sub-form. Now, everything works perfect!

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

Similar Threads

  1. Replies: 3
    Last Post: 11-01-2013, 10:16 AM
  2. Replies: 1
    Last Post: 06-24-2013, 11:31 AM
  3. Replies: 3
    Last Post: 03-09-2013, 10:39 AM
  4. Replies: 3
    Last Post: 02-06-2013, 07:23 PM
  5. Replies: 4
    Last Post: 08-14-2012, 07:14 AM

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