Check Box to be auto updated

R

reterrig

I have created a form "Proforma" & a subform "Proforma Subform". In the
subform, in the Form footer, I have a control box "Total Cost" that sum up
the amounts from filed "cost" of the same subform. In the form I have a
contol box "Total Euros" that is updated from the "Total Cost". In the form I
have also a check box "Paid" (control source of the chek box is Paid located
in a table) that is auto ticked when amount in "Total Euros" is greater than
Zero. This function is only happened when I close and re-open the form.
Is any way that the check box to be updated when the "Total Euros" is
updated without I close and re-open the form?

Thanks
Peter
 
B

BruceM

Since Paid is automatically ticked if TotalEuros is greater than 0 there is
no need to store the value. Similarly, you should not be storing TotalEuros
if the value is derived from the Sum in Proforma Subform. Instead, an
unbound text box (txtTotalEuros) on the main form could have as its Control
Source:
=Forms![Proforma]![Proforma Subform].Form![txtTotal]

You could have something like this in Proforma Current event:
Me.chkPaid = (Me.SubformControlName.Form.txtTotal > 0)
You could have a similar expression in the After Update event of a control
on the subform:
Me.Parent.chkPaid = (Me.txtTotal > 0)
Without knowing more details it's hard to know just where this expression
would go, but that's the general idea.

In the above, txtTotal is an unbound text box in the subform footer with a
Sum expression as its Control Source; chkPaid is an unbound check box on the
main form.

If you must do this with stored values for Paid and TotalEuros it is a
question of what the expression is and where it is located. You say that
you have a function, but that says very little to those who can't see your
database.
 
R

reterrig

Thanks for your assistance. Check Box works fine.

BruceM said:
Since Paid is automatically ticked if TotalEuros is greater than 0 there is
no need to store the value. Similarly, you should not be storing TotalEuros
if the value is derived from the Sum in Proforma Subform. Instead, an
unbound text box (txtTotalEuros) on the main form could have as its Control
Source:
=Forms![Proforma]![Proforma Subform].Form![txtTotal]

You could have something like this in Proforma Current event:
Me.chkPaid = (Me.SubformControlName.Form.txtTotal > 0)
You could have a similar expression in the After Update event of a control
on the subform:
Me.Parent.chkPaid = (Me.txtTotal > 0)
Without knowing more details it's hard to know just where this expression
would go, but that's the general idea.

In the above, txtTotal is an unbound text box in the subform footer with a
Sum expression as its Control Source; chkPaid is an unbound check box on the
main form.

If you must do this with stored values for Paid and TotalEuros it is a
question of what the expression is and where it is located. You say that
you have a function, but that says very little to those who can't see your
database.

reterrig said:
I have created a form "Proforma" & a subform "Proforma Subform". In the
subform, in the Form footer, I have a control box "Total Cost" that sum up
the amounts from filed "cost" of the same subform. In the form I have a
contol box "Total Euros" that is updated from the "Total Cost". In the
form I
have also a check box "Paid" (control source of the chek box is Paid
located
in a table) that is auto ticked when amount in "Total Euros" is greater
than
Zero. This function is only happened when I close and re-open the form.
Is any way that the check box to be updated when the "Total Euros" is
updated without I close and re-open the form?

Thanks
Peter
 

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