update check box

R

reterrig

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"
 
D

Dennis

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
 
R

reterrig

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 said:
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 said:
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"
 
D

Dennis

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 said:
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 said:
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 said:
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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top