Form calculated field problem

  • Thread starter Thread starter KaiTi Yen
  • Start date Start date
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!!!
 
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.
 
Back
Top