Invalid use of Null - how to get rid off this message

R

RT

In one of my forms, I keep getting the message "Invalid use of null" with an
OK button. This message is harmless to my application. How do I remove this
message so it will not appear again?

All my table fields and the forms allow the null value so I dont know how
this message occurs.

Any tips will be appreciated.

RT
 
S

Sylvain Lafontaine

In the VBA window, set the Options --> General --> "Error Trapping" to
"Break on All Errors".

Access will then show you the line on which this error is occurring. A
possibility would be that you are trying to set a null value (from a
recordset?) to a non-variant variable, such as an Integer or a Long.
Checking with IsNull() before assigning or replacing the type of the
variable with Variant will correct the error.
 
B

BruceM

What does the OK button do? Some functions do not allow null values, even
if the field does. Check the Nz function in Help.
 
R

RT

Thanks for the great tip! I found the problem. I tried to assign a null
value to the picture property of an image control.

RT
 
Top