melissa_may1
Registered User.
- Local time
- Yesterday, 22:18
- Joined
- Nov 29, 2011
- Messages
- 41
Hi All!
I'm working with Access 2007 on a form that is used to select the accounts to be printed.
I've set up the form as "Continuous Forms" with a checkbox next to the account name. In the footer I have a "Total To Be Printed" text box, with the data source set to
=Abs(Sum([PRINTNOW]))
I'm using the Abs function because Sum is totaling the value of all of the checkboxes, and when the checkbox is ticked, it has a value of -1.
The form displays all of the accounts, and the total is printing in the footer.
Everything's great, right?
Well, almost!
The total in the footer is not calculated until the user clicks on a different row after checking or unchecking the box.
How can I make the total update after a checkbox is changed?
I've tried a number of ways, by putting code in the OnClick or AfterUpdate, but I can't seem to get the method of updating correct.
I was using txtCount = Abs(Sum([IPRINTNOW])) but Access doesn't like this, and I get a "Sub or Function Undefined" on the Sum() function.
I also tried making a query to return the Abs(Sum()), but I can't figure out how to get the query to update the textbox. This doesn't work either:
txtCount = DoCmd.OpenQuery("GetSum")
Any ideas?
Thanks!
I'm working with Access 2007 on a form that is used to select the accounts to be printed.
I've set up the form as "Continuous Forms" with a checkbox next to the account name. In the footer I have a "Total To Be Printed" text box, with the data source set to
=Abs(Sum([PRINTNOW]))
I'm using the Abs function because Sum is totaling the value of all of the checkboxes, and when the checkbox is ticked, it has a value of -1.
The form displays all of the accounts, and the total is printing in the footer.
Everything's great, right?
Well, almost!
The total in the footer is not calculated until the user clicks on a different row after checking or unchecking the box.
How can I make the total update after a checkbox is changed?
I've tried a number of ways, by putting code in the OnClick or AfterUpdate, but I can't seem to get the method of updating correct.
I was using txtCount = Abs(Sum([IPRINTNOW])) but Access doesn't like this, and I get a "Sub or Function Undefined" on the Sum() function.
I also tried making a query to return the Abs(Sum()), but I can't figure out how to get the query to update the textbox. This doesn't work either:
txtCount = DoCmd.OpenQuery("GetSum")
Any ideas?
Thanks!