Results 1 to 2 of 2
  1. #1
    masrymostafa is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2013
    Posts
    1

    Question Add checkboxs to form to speed edit through records PLEASE HELP!

    I am designing a database in Microsoft Access that is designed to help with a small school program. So I have a table which includes all the student info (first name, last name, phone number and Class number) and I made a form (with a tabular format) which includes only the First name, last name, and Class Fields. I want to make this form to be used so that the teacher can use a check box beside each name and add them all to a certain class with a button. This is so that it is much easier than changing the class for each and every student.



    THANKS!

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    This can probably be done with an INSERT SELECT sql action. The real trick is making sure the action isn't repeated and duplicate records created so would need to clear the checkbox fields immediately after the INSERT SELECT. That will require an UPDATE sql action.

    I use only VBA so following examples are for VBA to execute sql actions.

    The INSERT SELECT could be like:

    CurrentDb.Execute "INSERT INTO tablename(ClassID, StudentID) SELECT " & Me.ClassID & " As CID, StudentID FROM Students WHERE checkfield=True;"

    The UPDATE could be like:

    CurrentDb.Execute "UPDATE Students SET checkfield = False;"

    Now what event will trigger this code - perhaps a button Click.
    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. Using VBA to look for and edit certain records
    By element32d in forum Programming
    Replies: 13
    Last Post: 11-16-2012, 07:01 PM
  2. Query speed over a large number of records
    By GrantRawlinson in forum Queries
    Replies: 2
    Last Post: 06-15-2012, 11:03 AM
  3. for next with edit records
    By JJCHCK in forum Programming
    Replies: 15
    Last Post: 10-27-2011, 10:38 AM
  4. Replies: 3
    Last Post: 08-23-2011, 04:35 PM
  5. Form not letting me edit records
    By bbylls in forum Forms
    Replies: 3
    Last Post: 12-16-2009, 09:30 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