|  | update check box |  | |
| | | reterrig |  |
| Posted: Wed Sep 03, 2008 6:01 am Post subject: update check box |  |
In a form I have a control box named "BalanceDue" with Control source "(=nz([Expense Totals])-nz([Total Credit])" that sums up two other calculated control boxes I have also a check box (Yes/No). I need the check box to be updated automatically. In case the "BalanceDue" is Zero then ckeck box to be "Yes", If any other amount, positive or negative, then the check box to be "No" |
| |
| | | Dennis |  |
| Posted: Wed Sep 03, 2008 7:19 am Post subject: RE: update check box |  |
In the forms On Current event and in the after update event of any fields that can affect the calculation, put this code
If BalanceDue = 0 then CheckBoxName = True Else CheckBoxName = False End if
"reterrig" wrote:
| Quote: | In a form I have a control box named "BalanceDue" with Control source "(=nz([Expense Totals])-nz([Total Credit])" that sums up two other calculated control boxes I have also a check box (Yes/No). I need the check box to be updated automatically. In case the "BalanceDue" is Zero then ckeck box to be "Yes", If any other amount, positive or negative, then the check box to be "No" |
|
| |
| | | reterrig |  |
| Posted: Wed Sep 03, 2008 8:40 am Post subject: RE: update check box |  |
| |  | |
Denis, Thanks for your assistance. Please note that I have cinsert ommands as per your instructions but I get : Run-time error'2465' Microsoft Access cant' find field"" referred to in your expression.
Following might assist you in finding the error. I have a form Expense Report by Company with a subform Employees Subform. In the Employees Subform are the Fields: ExpenseItemAmount , ExpenseItemCredit and the CheckBox. Filtering on EmployeesID open another Form Expense Reports with Subform Expense Reports Subform filtered on ExpenseDetailsID. The form Expense Reports has the CheckBox and the control box named "BalanceDue". The Expense Reports Subform has Fields ExpenseItemAmount & ExpenseItemCredit. Trying to update the On Current Event of all these Fors & Subforms and the AftreUpdate event of the relevant fields in the forms the exist I get the above error. All above seems too complicate. I hope that is cleared. The CheckBox that appears in both subform & form is bound to a field "Paid" in a table "Expense Reports" though the other two fields are in the table "Expenses Paid"
"Dennis" wrote:
| Quote: | In the forms On Current event and in the after update event of any fields that can affect the calculation, put this code
If BalanceDue = 0 then CheckBoxName = True Else CheckBoxName = False End if
"reterrig" wrote:
In a form I have a control box named "BalanceDue" with Control source "(=nz([Expense Totals])-nz([Total Credit])" that sums up two other calculated control boxes I have also a check box (Yes/No). I need the check box to be updated automatically. In case the "BalanceDue" is Zero then ckeck box to be "Yes", If any other amount, positive or negative, then the check box to be "No" |
|
| |
| | | Dennis |  |
| Posted: Wed Sep 03, 2008 8:52 am Post subject: RE: update check box |  |
| |  | |
You are right, it is too complicated for me to visualise. All I can say is put the quantifiers in front of the statements e.g. If Forms![Form Name].BalanceDue = 0 then Forms![Form Name].CheckBoxName = True Else Forms![Form Name].CheckBoxName = False End if
To access sub forms use Forms![Form Name]![Sub Form Name].Form.ControlName
"reterrig" wrote:
| Quote: | Denis, Thanks for your assistance. Please note that I have cinsert ommands as per your instructions but I get : Run-time error'2465' Microsoft Access cant' find field"" referred to in your expression.
Following might assist you in finding the error. I have a form Expense Report by Company with a subform Employees Subform. In the Employees Subform are the Fields: ExpenseItemAmount , ExpenseItemCredit and the CheckBox. Filtering on EmployeesID open another Form Expense Reports with Subform Expense Reports Subform filtered on ExpenseDetailsID. The form Expense Reports has the CheckBox and the control box named "BalanceDue". The Expense Reports Subform has Fields ExpenseItemAmount & ExpenseItemCredit. Trying to update the On Current Event of all these Fors & Subforms and the AftreUpdate event of the relevant fields in the forms the exist I get the above error. All above seems too complicate. I hope that is cleared. The CheckBox that appears in both subform & form is bound to a field "Paid" in a table "Expense Reports" though the other two fields are in the table "Expenses Paid"
"Dennis" wrote:
In the forms On Current event and in the after update event of any fields that can affect the calculation, put this code
If BalanceDue = 0 then CheckBoxName = True Else CheckBoxName = False End if
"reterrig" wrote:
In a form I have a control box named "BalanceDue" with Control source "(=nz([Expense Totals])-nz([Total Credit])" that sums up two other calculated control boxes I have also a check box (Yes/No). I need the check box to be updated automatically. In case the "BalanceDue" is Zero then ckeck box to be "Yes", If any other amount, positive or negative, then the check box to be "No" |
|
| |
|
|