tick multiple check boxes on multiple sub-form records

tick multiple check boxes on multiple sub-form records

Post by Craig » Tue, 18 May 2004 02:18:22


Hi,

I have a form, frmInvoices and a subform, frmInvoicesSub.

On the parent form, i have a "print report" button, that prints a report
depending on an ID on the parent form.

Each record in the subform has a check box, "invoiced".

Currently, my print report button has the folowing code:

Forms![frmInvoices]![frmInvoicesSub].Form![AmIInvoiced] = 1

However, this only ticks the box on the first record.

Does anybody know how I can force all boxes to be ticked?

Thanks
Craig Mason
 
 
 

tick multiple check boxes on multiple sub-form records

Post by PC Datashe » Tue, 18 May 2004 02:53:10

The table your subform is based on should have an equivalent ID to the ID on the
main form. Create a query based on the subform's table and include that ID field
and your "invoiced" field. Set the criteria for the ID field to the expression:
Forms!FrmInvoices!ID. Turn the query into an update query and in the query tell
it to update the "Invoiced" field to True.

Add the following code to the beginning of the code for your print button:
Docmd.Setwarnings False
Docmd.OpenQuery "NameOfNewQuery"
Docmd.Setwarnings True
Me.Requery

 
 
 

tick multiple check boxes on multiple sub-form records

Post by Craig » Tue, 18 May 2004 04:21:34

That worked great,

Thanks!



on the
field
expression:
tell