'check all' function for continuous forms

303factory

Registered User.
Local time
Today, 16:46
Joined
Oct 10, 2008
Messages
136
Good morning all

I'm trying to set up a 'check all' tickbox in the header of my continuous subform, that will check or uncheck the desired field for every row displayed in the subform.

All I can think of is opening a the recordset that matches the form, cycling through the rows, and setting the field to the desired value, then refreshing the form.

I'm wondering if there is a faster and more cunning way to do this.. any ideas?
 
Have look at 'Update' query

Thanks. I'm successuflly updating the table with the following code, but I have one problem and one question. First here's the code I'm using:

Code:
If Me.ReportAll = True Then
        strSQL = "UPDATE tblMessages SET Report = True WHERE UniqueRef=" & gUniqueRef
    Else
        strSQL = "UPDATE tblMessages SET Report = False WHERE UniqueRef=" & gUniqueRef
    End If
    
   DoCmd.SetWarnings False
    DoCmd.RunSQL strSQL
    DoCmd.SetWarnings True
Me.Refresh
The question: Is it possible to update the table based on the form recordsource instead of manually coding out the WHERE specifics? I have many subforms with many different recordsets, it will be a lot of code to manually spell out the recorset every time I want to do a mass update.

The problem: The above code works if I update the entire messages table, but if I code in the specific recorset displayed on the form and update that, I get a write conflict (save/copy to clipboard/drop changes) on the Me.Refresh line. Any idea why this might be? EDIT: The form is based on an msaccess query and the update function is directly accessing the SQL Server back end.. think this might be related?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom