Hi,
I have a continuous form and each line displays a record form a table. One of the fields from this table is a checkbox.
I also have another text box in the form footer which looks up a value from an underlying query using DLookup.
I use the checkbox to select certain records. When I click on the checkbox I want the text box to requery itself and display a (possibly) updated value because it now takes into account this record also.
I have tried the following:
1. In the OnClick event of the check box I have:
Me![name_of_textbox].Requery
This doesn't work, I have to click on another checkbox to just get the value of the one clicked previously. Obviously I now have one more record then I need selected. No good.....
2. Next I tried setting the focus before requerying in the OnClick:
Me![some_other_control].SetFocus
Me![name_of_textbox].Requery
Still nothing.... Same problem as highlighted in .1
3. In the OnClick event of the checkbox I have:
Me![some_other_control].SetFocus
and then in the OnLostFocus event of the checkbox :
Me![name_of _checkbox].Requery
this doesn't work either, I still have to select one more record then required before I get the correct total value in the text box.
What can I do to fix this???
Liam
I have a continuous form and each line displays a record form a table. One of the fields from this table is a checkbox.
I also have another text box in the form footer which looks up a value from an underlying query using DLookup.
I use the checkbox to select certain records. When I click on the checkbox I want the text box to requery itself and display a (possibly) updated value because it now takes into account this record also.
I have tried the following:
1. In the OnClick event of the check box I have:
Me![name_of_textbox].Requery
This doesn't work, I have to click on another checkbox to just get the value of the one clicked previously. Obviously I now have one more record then I need selected. No good.....
2. Next I tried setting the focus before requerying in the OnClick:
Me![some_other_control].SetFocus
Me![name_of_textbox].Requery
Still nothing.... Same problem as highlighted in .1
3. In the OnClick event of the checkbox I have:
Me![some_other_control].SetFocus
and then in the OnLostFocus event of the checkbox :
Me![name_of _checkbox].Requery
this doesn't work either, I still have to select one more record then required before I get the correct total value in the text box.
What can I do to fix this???
Liam
Last edited: