Form calculated field problem

K

KaiTi Yen

I create a form with two fields. Their data type
is 'Date'. Then I create a calculate filed to calculate
the total number of days between those two dates. I got
two problems:
1). I got error message saying "Runtime error 94:Invalid
use of Null" when I open the form and try to enter a brand
new record.
2). The result of the calculated field won't write to the
table field.

Please help!!!! I really appreciate!!!
 
M

Mike Painter

KaiTi Yen said:
I create a form with two fields. Their data type
is 'Date'. Then I create a calculate filed to calculate
the total number of days between those two dates. I got
two problems:
1). I got error message saying "Runtime error 94:Invalid
use of Null" when I open the form and try to enter a brand
new record.
2). The result of the calculated field won't write to the
table field.

One or both of the fields are Null when you start.
You can use the NZ function to stop this.

Calculated fields in general should not be written to tables.
There are exceptions but this is probably not one of them.

You would use something like Me!YourfieldName = DateDiff ( etc) to write the
information.
 

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