Results 1 to 5 of 5
  1. #1
    chrisdogg is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    6

    Problem With Subform Adding Records To Main Table & More :-(

    Good Afternoon,




    I tried searching for this topic and was unable to find an answer for my problem. I'm going to try and explain my problem as best as possible. Here it goes:


    I have a main form that holds contacts. The main form contains a subform where I am listing the events that the contact has volunteered to work. I am able to add multiple events for each contact. When I add an event to a contact it's recorded in a table named "tblContacts_Events" and everything appears to display correctly, where ContactID "1" and assigned to EventID "3" and then another row that may say ContactID "1" is assigned to EventID "9". I have a main events table called "tblEvents" that holds the event name, event date, and event description.


    The problem that I am having is that records are being added to the "tblEvents" table. I don't want this. All I want to do is to be able to assign a contact to multiple events in the "tblContact_Events" table. I am using a query as my recordsource for the subform and I'm sure that's I'm having this issue because the query is not set up correctly but at this point I'm lost and need some help.


    Another issue that I'm having is that when I keep selecting events within the subform, my "EventID" is starting to display a number more than the number of events that I have listed in the tblEvents table. For instance, the subform for my first contact is showing:


    Click image for larger version. 

Name:	pic.PNG 
Views:	11 
Size:	8.4 KB 
ID:	27086


    But I only have nine events listed in the table! On top of that the drop down list in the subform is starting to display numbers instead of the the event names.


    So as you can see I'm all messed up over here. Hopefully I've provided enough information about my issue. Any assistance would be GREATLY appreciated!! Thanks.

  2. #2
    aytee111 is offline Competent At Times
    Windows 7 32bit Access 2013 32bit
    Join Date
    Nov 2011
    Location
    Nomad
    Posts
    3,936
    The EventID displaying above looks like an autonumber field on the contacts table when it should be a number.

    The Eventname combobox should have its control source as the event id from the contacts table.

    The record source for the subform should be the contacts table.

    The event name combobox should have its Limit To List property set to Yes.

    Your relationships window should have referential integrity set between the contacts table/event id and the events table/event id.

    Hope some of this lands on target.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Well, the subform should be bound only to tblContacts_Events (or a query that only includes that table). See if that resolves the other issue as well. You may be seeing the ID from the junction table rather than the events table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    chrisdogg is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    6
    Hey pbaldy,

    The subform is bound to the tblContact_Events table. I'm going to continue to mess around with it to see if I can get it to work.

  5. #5
    chrisdogg is offline Novice
    Windows 10 Access 2016
    Join Date
    Jan 2017
    Posts
    6
    Thanks aytee111

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

Similar Threads

  1. Replies: 4
    Last Post: 09-08-2016, 06:35 AM
  2. Replies: 1
    Last Post: 07-10-2015, 06:38 PM
  3. Replies: 3
    Last Post: 11-04-2012, 09:25 AM
  4. Replies: 1
    Last Post: 10-21-2012, 04:57 PM
  5. Replies: 4
    Last Post: 06-18-2012, 07:01 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