Results 1 to 5 of 5
  1. #1
    mjwakema is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2015
    Posts
    3

    Relationship question


    Hello, I am trying to learn Access 2013 and to do so I am setting up a simple journal. I have 3 tables. The MyJournal has foreign keys to the attachment table and the DateEntered table. I separated out the attachments and the date as I will have many dates for each journal entry and may or may not have an attachment.

    When I create a query (MyDate, JournalEntry, Attachments) I can open the query and enter a new date, but I cannot enter anything into the JournalEntry field. I keep getting the same error. "The value cannot be added to this new row until the row has been committed. Commit the row first, and the try adding the value." If I go to a new record and then come back, then I can enter a text into the journal entry.

    Have I set up my relationships correctly?

    Thank you for the support!

    Mike

    Click image for larger version. 

Name:	Relationships.jpg 
Views:	15 
Size:	21.7 KB 
ID:	22539

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Have I set up my relationships correctly?
    If each journal entry (in MyJournal_TBL) can have many dates, and each entry can have zero or one (or more?) attachments, then your relationships are reversed, and use the wrong fields.

    Attachments_TBL and DateEntered_TBL require the field MyJournalID as a FK to MyJournal_TBL, and the relationships have to be defined using that field.

    I strongly suggest that you do not try to use a query for entering data; instead use a form - subform arrangement, which is one of the commonest ways of working with one-to-many relationships.

  3. #3
    mjwakema is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2015
    Posts
    3
    Thank you for the response. I used the query as an example. I was having the same issue with a form. I was leaning in the direction that I have something backwards but was struggling to fully understand it. I will switch these around. Again, thank you.

    Mike

  4. #4
    mjwakema is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Oct 2015
    Posts
    3
    This work and it makes so much more sense then what I was doing.

    Thank you

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870

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

Similar Threads

  1. One to One Relationship question
    By ittechguy in forum Database Design
    Replies: 2
    Last Post: 09-09-2015, 07:50 AM
  2. Relationship Question
    By Collins in forum Database Design
    Replies: 6
    Last Post: 06-04-2015, 12:07 PM
  3. Table relationship question
    By Lothar in forum Database Design
    Replies: 4
    Last Post: 06-16-2014, 03:58 PM
  4. Relationship question
    By txlibertygirl in forum Access
    Replies: 2
    Last Post: 10-13-2011, 08:59 PM
  5. Relationship Question on one-many
    By daveofgv in forum Database Design
    Replies: 2
    Last Post: 05-08-2011, 10:39 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