468,765 Members | 1,722 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

tick multiple check boxes on multiple sub-form records

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
Nov 12 '05 #1
2 3481
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

Nov 12 '05 #2
That worked great,

Thanks!

"PC Datasheet" <sp**@nospam.spam> wrote in message
news:aU******************@newsread3.news.atl.earth link.net...
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


Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Marta Pia | last post: by
10 posts views Thread by Martin Eyles | last post: by
5 posts views Thread by John | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.