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
--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com www.pcdatasheet.com
"Craig M" <No**@mPlz.Thx> wrote in message
news:40***********************@news-text.dial.pipex.com...
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