472,958 Members | 2,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

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 3705
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: CSDunn | last post by:
Hello, I have a situation in which I need to address three SQL Server 2000 Stored Procedure parameters in the OnClick event of an Option Group. The Option Group lives on an Access 2000 ADP form. ...
0
by: Marta Pia | last post by:
Hello, I have a ListView control with CheckBox = true. What I'd like to do is tick all the check boxes when the items are selected. I've tried to put this on the ListView_SelectIndexChanged...
10
by: Martin Eyles | last post by:
Hi, I want to make a scale on a graph, by telling asp to insert empty divs of class tick, and the setting the style in css. I am trying to get a 3D effect by using colored top and bottom borders...
7
by: Demonicpagan | last post by:
I have this form where I am trying to place items from checked boxes into a text box. An image of what this form looks like is at http://www.stelth2000inc.com/images/screen.png Here is some...
5
by: John | last post by:
Hi I have a bound gridview. I need to allow users to select multiple rows and then press the process button to process multiple selected rows. For this I want to use additional column of...
8
by: KnighT | last post by:
I have a .net service that runs a System.Threading.Timer. The delegate points to the function that the service should execute when the timer elapses. Problem: The timer is not ticking. I have...
3
by: LuCnt | last post by:
I am using Visual basic 6 and i want to be able to select more that one response in a option group with check boxes. As it is now i can only select one response at a time. the code looks like this....
4
neo008
by: neo008 | last post by:
Hi all, Finally gave up and putting it here. I am new to visual basic stucked up with an error- Run time errors.'-2147217887 (8004021)': Multiple-step operation generated errors. check each...
1
by: Inaccessable | last post by:
This is probably very simple but still beyond me. I have a table that stores text in a number of different languages. Each entry has a unique ID number. Each language version of the same text...
7
by: Humakt | last post by:
This is 2D game where there are breakable boxes in the middle two bats on both sides and one or more balls breaking the boxes. Kind of like a mixup of pong and breakout. Collision detection...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.