Results 1 to 6 of 6
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Checkable checkbox in a query of group

    I have areas, and schools that have a date value in their datefield grouped by their area.



    I thought adding a checkbox for the area that is grouped would allow me to have it so that I could check the area, and then using a button on a form - null those areas that are checked.

    However in the query the checkbox (which is coincidentally grouped in the query) won't check. Is there a way around this as I would like to be able to select multiple areas by checking them and then having a button null the date fields for the schools within that area.

    Would I have to use an unbound checkbox?

    Click image for larger version. 

Name:	Capture2.JPG 
Views:	8 
Size:	50.0 KB 
ID:	13840

    Click image for larger version. 

Name:	Capture.JPG 
Views:	8 
Size:	69.3 KB 
ID:	13841

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows XP Access 2003
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,610
    I don't think you can change the data in a query that has a GroupBy clause. I think you could use a multiselect listbox on a form to display the areas. Then use code in the OnClick event of a button to change the data of the selected areas.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by Bob Fitz View Post
    I don't think you can change the data in a query that has a GroupBy clause. I think you could use a multiselect listbox on a form to display the areas. Then use code in the OnClick event of a button to change the data of the selected areas.


    I'd love to be able to only update the date fields those schools that are queried... is there another way? It's not the areas I need to change/update but the table linked.

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    An unbound checkbox wouldn't work because unbound control reflects the same value for all displayed records.

    Could possibly use a listbox that allows multi-selection then code would cycle through the listbox items and run an UPDATE sql for the selected items.
    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.

  5. #5
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by June7 View Post
    An unbound checkbox wouldn't work because unbound control reflects the same value for all displayed records.

    Could possibly use a listbox that allows multi-selection then code would cycle through the listbox items and run an UPDATE sql for the selected items.
    ok I will give that a go. I am guessing update sql in vba?

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Yes, execute SQL in 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.

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

Similar Threads

  1. Yes No Checkbox in Query
    By buckwheat in forum Forms
    Replies: 2
    Last Post: 07-01-2013, 09:46 AM
  2. If checkbox is checked allow query to run
    By burrina in forum Forms
    Replies: 14
    Last Post: 01-29-2013, 03:56 PM
  3. Form Checkbox Query
    By rlsublime in forum Access
    Replies: 1
    Last Post: 03-12-2012, 12:10 PM
  4. Datestamp for Checkbox-Query
    By Ran in forum Programming
    Replies: 24
    Last Post: 01-18-2012, 11:22 AM
  5. query group by over another group by?
    By gap in forum Queries
    Replies: 2
    Last Post: 07-04-2011, 12:59 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