Results 1 to 5 of 5
  1. #1
    ino_mart is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    16

    Create editable "pivot"-form

    All

    A simplified explanation for what I try to reach. I use MS Access 2019.

    I have a table Students which contains next fields: ID (primary key) and StudentName (long text)
    I have a table Courses which contains next fields: ID (primary key) and CourseName (long text)
    I have a table StudentCourses which contains fields: StudentID_FK and CoursesID_FK

    I now want to create a form with a dynamic editable pivot table in which the cells contain checkboxes which I can select or deselect.
    If I add a new course "History" this column must be automatically added.

    So: the X is a checkbox which is enabled. The checkbox for Nick in column English is enabled but it is disabled in column Math.
    I think I have to add some boolean field in table StudentCourses (eg ToFollow) but then I still do not know how to create a form as below. I tried to create a crosstab-query but that is non-editable.

    Student / Course English Math Biology ...
    Nick X X
    Peter X
    Sam X X
    ...

    Regards


    Ino

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    And you want the results to feed back into table? With an unbound form and lots and lots of VBA.
    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
    ino_mart is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    16
    Quote Originally Posted by June7 View Post
    And you want the results to feed back into table? With an unbound and form and lots and lots of VBA.
    Indeed, the results should be saved into the database

  4. #4
    kd2017 is offline Well, I tried at least.
    Windows 10 Access 2016
    Join Date
    Jul 2017
    Posts
    1,142
    Maybe something like this?:
    1. Use vba to build a temporary table
    2. Use your crosstab query to populate the temp table
    3. Your form can use the temp table as its data source and can have n check box controls and use vba to show, hide, relabel and bind to fields them as necessary.
    4. Use queries/vba to process the temp table back into your normalized tables and
    5. Drop the temp table.

  5. #5
    ino_mart is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Sep 2011
    Posts
    16
    Quote Originally Posted by kd2017 View Post
    Maybe something like this?:
    1. Use vba to build a temporary table
    2. Use your crosstab query to populate the temp table
    3. Your form can use the temp table as its data source and can have n check box controls and use vba to show, hide, relabel and bind to fields them as necessary.
    4. Use queries/vba to process the temp table back into your normalized tables and
    5. Drop the temp table.
    That's indeed a good suggestion. I will try and let you know.

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

Similar Threads

  1. Replies: 4
    Last Post: 12-20-2015, 12:16 PM
  2. Replies: 1
    Last Post: 09-07-2015, 08:00 AM
  3. field in query "not editable" ...
    By fluppe in forum Programming
    Replies: 8
    Last Post: 10-22-2014, 01:07 AM
  4. Replies: 3
    Last Post: 07-23-2011, 09:12 AM
  5. Replies: 19
    Last Post: 10-20-2010, 01:27 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