my guess is that you may need to use NZ or test for null before making
an assignment or constructing a string...
from Help
'~~~~~~~~~~~~~~~~~~~~~~~~~~``
Nz Function
You can use the Nz function to return zero, a zero-length string ("
"), or another specified value when a Variant is Null. For example, you
can use this function to convert a Null value to another value and
prevent it from propagating through an expression.
Syntax
Nz(variant[, valueifnull])
The Nz function has the following arguments.
Argument
variant
A variable of data type Variant.
valueifnull
Optional (unless used in a query).
A Variant that supplies a value to be returned if the variant
argument is Null. This argument enables you to return a value other than
zero or a zero-length string.
Note If you use the Nz function in an expression in a query without
using the valueifnull argument, the results will be a zero-length string
in the fields that contain null values.
'~~~~~~~~~~~~~~~~~~~~~~~~~~``
the thing to keep in mind when using Nz is what it will return if you
don't the specify the second, optional, argument.
If you are using Nz on a field, it will be the data type of that field
-- 0 for numbers (including dates), and an empty string for text or memo
Unbound textbox / combobox / listbox controls on a form are assumed to
have TEXT in them... so an empty string will be returned if nothing is
specified. And, if you specify something, it doesn't have to be 0 or ""
you could do this:
NZ(<expression>,"no commision is found in the table for this employee")
If you do not specify the optional argument -->
If the expression is bound to a text field, an empty string will be
returned if the field is null. If the expression is bound to a numeric
field, 0 will be returned if the field is null.
it is a good idea to wrap return values from dLookup, etc, in NZ in case
no match was found
.... a good "rule-of-thumb" is to specify the optional arguments (even
though it is not necessary) ...
= Nz(DLookup("[Commission]", "Employees", "[EmpID] = " & nz([EmpID],0)),0 )
notice how NZ is used twice -- once to make sure the criteria will be
evaluated, and another time around everything in case dLookup didn't
return a value...
Warm Regards,
Crystal
*

have an awesome day

*
MVP Access
Remote Programming and Training
strive4peace2006 at yahoo.com
*