views:

32

answers:

1

I developed an Access 2003 database with a form that has a number of bound input text fields. As the user update the value in these fields, the table is updated with the changed value. I also have an unbound textfield that displays a calculated value from the user input. This does not use the values from the textfields on the form, but directly from the table.

The Control Source of this textfield is something like:

=[field1]+[field2]+[field3]

Rather than

=txtInput1.value+txtInput2.value+txtInput3.value

In Access 2003, the calculated textfield get updated automatically as a user changes the bound input fields. However some of the users are using Access 2007 and they don't get the calculated field updated automatically, unless they reload the form.

It only updates automatically if I use the input textfields rather than the bound fields to perform the calculation.

I have selected "Allow this content" in the security warning. Is there anything else I can do to make it behave like in Access 2003?

Thanks

A: 

Is there anything else I can do ...

Assuming your text box with that expression is named txtFoo, you could try something like this in the After Update events of your txtInput1, txtInput2, and txtInput3 controls:

Me.txtFoo.ReQuery

Maybe try it for txtInput1 first, and then apply it to the others if it accomplished what you want.

I would change the control source for txtFoo instead of adding code for After Update:

=txtInput1+txtInput2+txtInput3

I don't think you need to explicitly include the Value property with each of them, because Value is the default property for a text box.

HansUp
Why not .Refresh?
David-W-Fenton
What advantage does .Refresh offer over .Requery in this situation?
HansUp
I am currently forced to use the input fields for the calculations.I've about 50 input fields on this form across several tabs, so don't really want to be adding refresh or requery on the update event of each one. I would like to know why 2007 is behaving this way though.
Sivakanesh
Refresh retrieves less data than a Requery, depending on what you're Refreshing/Requerying. I always would prefer it as first alternative before a Requery, until it's demonstrated that the Refresh doesn't do the trick.
David-W-Fenton
I suggested Requery for a list box. Refresh is not available for a list box. But perhaps my suggestion was misguided because your comment makes me realize I don't understand the impact of Requery for a control vs. the form.
HansUp
I'm not sure I understand it, either, but I always try Refresh before Requery, unless I know for certain I really do want to Requery (such as in a combo box whose underlying table has been edited).
David-W-Fenton