By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,008 Members | 2,962 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,008 IT Pros & Developers. It's quick & easy.

Testing Calculated Form Field.....

P: n/a
Hi,

I have a form with a couple of calculated fields.
I want to put some code into the 'Form-Load' event to set various
object states on the form, depending on the value of these fields.

The problem is that the calculated fields are blank for a split second
when the form opens, and then the value appears. This makes any tests
fail. How can I test against these fields once the calculation has been
done ?

This seems impossible unless I write it to a field ?
Appreciate your soonest.
David.

Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
da***@scene-double.co.uk wrote:
Hi,

I have a form with a couple of calculated fields.
I want to put some code into the 'Form-Load' event to set various
object states on the form, depending on the value of these fields.

The problem is that the calculated fields are blank for a split second
when the form opens, and then the value appears. This makes any tests
fail. How can I test against these fields once the calculation has been
done ?


- the testing code could do me.recalc;
- consider trying the Activate event instead of Open;
- depending on the calculations, do these in code instead of in form
controls

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Nov 13 '05 #2

P: n/a
In Access 97, it was possible to test calculated fields. In Access 2000 and
2002, I have found that reading values from calculated fields is fundamentally
unstable. In any cases where I have a value important enough to want to test
it, I'll now calculate it in code or calculate it in the query rather than
using an expression in a control source.

If you need to calculate an aggregate in code, you can loop through the form's
RecordsetClone. I have written some simple custom helper functions to make
this easier in my own code.

On 7 Dec 2004 09:11:54 -0800, da***@scene-double.co.uk wrote:
Hi,

I have a form with a couple of calculated fields.
I want to put some code into the 'Form-Load' event to set various
object states on the form, depending on the value of these fields.

The problem is that the calculated fields are blank for a split second
when the form opens, and then the value appears. This makes any tests
fail. How can I test against these fields once the calculation has been
done ?

This seems impossible unless I write it to a field ?
Appreciate your soonest.
David.


Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.