Invalid Use of Null

jmullins91

New member
Local time
Yesterday, 19:53
Joined
Feb 5, 2013
Messages
1
After a couple of years in retirement decided to go back to work. Current employer is utilizing two different database systems. The one in question was created on Access 2002. Since it's been more than a couple of years (6) working with Access need some help in resolving this problem. The problem that is occuring regards running month end closeout. When attempting to run report get the following error:

"The expression on Click you entered as the event property setting produced the following error: Invalid Use of Null.

The expression may not result in the name of a macro, the name of the user defined function, or (Event Procedure).

There may have been an error in evaluating the functions, event or macro.

One website that I visited indicated this could be a corrupted database. So I'd appreciate any help in how to resolve this issue.

Frustrated Manager
 
You can try a compact and repair operation on the database if you think the issue is with a corrupted database.

You can also try a decompile operation:
All one line for the command, adjust your paths appropriately.

"c:\program files\microsoft office\office\msaccess.exe" "T:\design\lab\lab.mdb" /decompile
 
Hello jmullins91, Welcome to AWF.. :)

I do not think it is because of a corrupted DB yet !!

There might be some simple misuse of a VBA function in either your report or Query.. Check the OnClick code..

Some string manipulation functions, require a String.. If you try passing Null values to them.. for example Len(Null), that is an invalid Use of Null..
Or if you try to assign a Null value for any other Data Type other than Variant you will get the Exact same error..
 
I agree with Paul.. it may be too early for the Compact/Repair.

It could be some bad data/missing data that is not being handled properly. You may wish to check incoming data with some sort of

If IsNull(IncomingFieldName) Then

'take some sort of action here
' MsgBox/Error????
else
'Continue with your regular proecessing
end if

Lots of reasons for improper use of Null.

Good luck.
 

Users who are viewing this thread

Back
Top Bottom