Results 1 to 11 of 11
  1. #1
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727

    Many:many data entry form

    All, I'm using Access 2016..I have a database that the user want to add a table to enter and keep track of incidents. The table was created but because it was related to an existing table in the database, I had to create a junction table because of it's m:m relationship. I need design advice on how to create a data entry form for incidents for the users to create and tie multiple defectids from the other table in which it has the m:m relationship...in other words..create the incident then be able to select multiple defects tied to this incident and store them into the perspective tables...I was thinking I need to create a listbox to be able to select two or more items but that wouldn't work unless the field held multiple values. Maybe a datasheet view to input multiple line items...I don't know...any suggestions would be appreciated to point me in the right direction..

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Use a form/subform arrangement.

    Main form bound to Incidents.

    Subform bound to IncidentDefects.

    Combobox in subform to select Defect.

    What are 'perspective tables'? Why plural?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    Thanks for responding...perspective tables..wrong choice of words...data entry into the tables Incident and incidentdefects. I will try this but would I need to put the subform in datasheet veiw and where should the combobox be? Trying to envision this setup...

  4. #4
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,725
    Can you post a jpg/png of your tables and relationships?

    seems

    --- Incident-->IncidentHasDefect<----Defect

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Subform can be in any display view (Single, Continuous, Datasheet).

    The combobox would be placed wherever you want on subform.

    You need to build two forms: one bound to Incidents and one bound to IncidentDefects. IncidentDefects form will be used as subform sitting on Incidents form.

    This is basic Access design and functionality.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    I will in a couple of hours...after my meeting

  7. #7
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    Click image for larger version. 

Name:	Screenshot 2019-09-10 20.49.29.jpg 
Views:	22 
Size:	70.6 KB 
ID:	39697attached is my diagram..

  8. #8
    ssanfu is offline Master of Nothing
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Note that "Case" is a reserved word and shouldn't be used for object names.

  9. #9
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    So, I got the form done based on all your suggestions..I have the subform working with the cbo box so the user can select one or more defects...but, I realized I needed the defect filtered based on the case defect field..so I added a field called case defects on the form with a cbo box to be selected before the defect cbo...the user has to select the defect based on the case defects selection...so, I added the case defects field in the defect cbo query n set the criteria based on the forms selection i.e. forms!frm......
    The defect cbo box worked before but since I added the criteria so it would only return defects based on the case defect filter now it only works if I have the subform in single view not datasheet view..I need it in datasheet view because there can be many defects to one issue n vice versa...can anyone tell me what I did wrong pls. Thanks

  10. #10
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,921
    Cascading combobox is common topic. Requires VBA code to Requery combobox when moving to new record and when changing the case value.

    Be aware cascading combobox with alias doesn't work nice with Continuous and Datasheet because when combobox list is filtered alias values are not available for display. Managing this is tricky and subject of many discussions.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  11. #11
    slimjen is offline Expert
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    727
    Thanks....I got it to work! I compacted the database and it started working...🤔

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

Similar Threads

  1. Replies: 2
    Last Post: 12-11-2015, 02:55 PM
  2. Replies: 3
    Last Post: 02-25-2015, 04:48 PM
  3. Replies: 5
    Last Post: 03-09-2014, 07:16 PM
  4. Replies: 7
    Last Post: 02-08-2014, 12:31 PM
  5. Replies: 5
    Last Post: 08-12-2013, 12:53 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