Results 1 to 9 of 9
  1. #1
    jmayojr is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Nov 2016
    Location
    Boston
    Posts
    8

    Adding New Fields Automatically?

    Hello everyone, I'm in the process of developing a database for work that will be used to track conduct records for students. My ideal setup is to have the users (my staff and I) create a record for each incident, then associate each student to that incident using their ID numbers. My question is regarding my Incident Table. It's set for basic information collection, the what, when where of the incident. I want to also add the who (students) when I create the record. The student's information (StudentID, Name, etc) lives in my Student information table. My question is this: is there a way to have access create fields as I add ID numbers, or would I have to have the table preset with a number of fields like "Student1" "Student2" etc? I appreciate the help.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You do not want fields like "Student1" "Student2", you want a related table:

    Fundamentals of Relational Database Design -- r937.com
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    jmayojr is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Nov 2016
    Location
    Boston
    Posts
    8
    Thanks Paul. I read through that resource and it's helpful. I think I got the design. If I follow a second normal form style it might work. Something like this...

    tblIncidents
    IncidentID - pk
    IncidentDate

    tblStudents
    StudentID - pk
    StudentFirstName
    StudentSecondName
    StudentEmail

    tblIncidentDetail
    IncidentID - pk
    StudentID - pk
    IncidentLocation
    Violation (this pulls from tblViolations as a Lookup/Combobox right now)

    This way each incident can have more than one student associated with it. Ideally my reporting would be by incident with details on each student, then another report for each student that lists all the incidents they've been a part of.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Looks good. The third table is what's often called a many-to-many junction table. A student can be have many incidents, an incident can have many students.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    jmayojr is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Nov 2016
    Location
    Boston
    Posts
    8
    Thanks again!

    Quote Originally Posted by pbaldy View Post
    Looks good. The third table is what's often called a many-to-many junction table. A student can be have many incidents, an incident can have many students.

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Happy to help and welcome to the site by the way! To clarify, I assume the location can vary by student? If not, it should be field in the incidents table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    jmayojr is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Nov 2016
    Location
    Boston
    Posts
    8
    Location will vary by incident for reporting standards, either on-campus, off-campus, or adjacent to campus possibly others at a future point.

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    If it only varies by incident, it should be a field in the incidents table, not the junction table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    jmayojr is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Nov 2016
    Location
    Boston
    Posts
    8
    Ok, here is the table layout with relationships.... let me know what you think... Thanks!

    The basic goal is to have the database track incident information and hearing information and outcomes.

    Relationships for New Conduct Database.pdf

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

Similar Threads

  1. Replies: 10
    Last Post: 02-25-2015, 09:29 PM
  2. How to stop form automatically adding records
    By linuxson in forum Access
    Replies: 33
    Last Post: 07-01-2014, 06:33 AM
  3. Replies: 1
    Last Post: 08-06-2013, 07:52 PM
  4. Replies: 16
    Last Post: 02-06-2013, 09:23 AM
  5. Automatically Adding New Data to Tables
    By aquarius in forum Import/Export Data
    Replies: 1
    Last Post: 09-15-2010, 07:27 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