Results 1 to 7 of 7
  1. #1
    ep4tech is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    3

    Insert a group of records.


    Hi,
    I have a student database contains the following tables:
    Student Table (Id, StudentName, ClassNum, ....)
    and action Table (Id, ActionDate, studentID,Status, reason, note)
    Status fields possible values are: attended(=1) absent (=2), permitted(=3).
    I want to build a form has the two unbound fields (Class Number and date) in the top of the form. a sub form should contain a grid (list) of all the students of that class number; each row of that grid consists of: Student name (non editable), status (drop-down list for example), reason (text box),)
    The form should show all the class students.
    When the user enters data (status, reason mad notes) the form should create a record in the action table With the student id, the date (entered in the top section) and the add data (i.e. status, reason mad notes)
    How can i build a form contains records from a table (with records not exist before adding them).

    Thanks in advance.

  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 can execute an append query that pulls the appropriate students from the student table and gets the date and class number from the form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ep4tech is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    3
    My question about the other
    fields (status, reason and note) there should be a place (grid fro example) to enter them.

  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
    I would expect the subform to be bound to that table, enabling you to add that info.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    ep4tech is offline Novice
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    3
    If you are referring to the Student table, then student table doesn't contain the required fields (status , reason and note)
    If you are referring to the action table, then action table doesn't contain any row bound to that date and class number. Hence, the form will contain no rows.

    The form needs to show all the student names (from student table filtered by class num: the unbound control at the top of the form), date (from the unbound field top of the from) , the rest of the fields will be null values (i.e status , reason and note)
    The records in action table will not be created until the data is entered and saved.

  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
    I was suggesting appending records to the action table at the start of this process, so it had records for each student for that date, allowing you to fill in the other fields.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    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.

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

Similar Threads

  1. Insert records of an array
    By Erick Gamer in forum Modules
    Replies: 13
    Last Post: 09-13-2017, 11:46 AM
  2. Replies: 2
    Last Post: 11-26-2016, 01:07 PM
  3. Insert records from one recordset into another
    By CanuckBuck in forum Programming
    Replies: 2
    Last Post: 01-19-2016, 01:33 PM
  4. Top 25 records per group
    By JKnightly in forum Queries
    Replies: 3
    Last Post: 10-12-2015, 10:20 AM
  5. TOP (N) Records in a Group
    By wcrimi in forum Queries
    Replies: 42
    Last Post: 01-03-2015, 11:54 AM

Tags for this Thread

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