View Full Version : Invalid Use of Null94


mrabrams
03-05-2001, 01:32 PM
While scrolling through the records, every so often I get the "Invalid use of Null94" error message.

Now I understand Invalid use of Null, but what does the 94 mean? It might help me figure out what is wrong.

Thanks,
Michael Abrams

Fornatian
03-05-2001, 10:48 PM
each and every error generated by Access has a defined error number and error description.
These can be accessed in code by using the following line:

err.number & err.description

The '94' you speak of is the error number
The 'Invalid use of Null' is the error description.

So why do the errors have numbers assigned?
So you can identify them and manage the particular instance of a certain kind of error. This is usually done by using a select case or if..then..else statement in the error handling part of teh sub procedure to ascertain the number of the error and then take appropriate action.

For instance, say you want to put a different error message up when 94 occurrs use something like this in the code:

Sub MySubsName()

On Error Goto Err_MySubsName

'Your action code here

Exit_MySubsName
'standard exit command
Exit Sub

Err_MySubsName
'compare err.number
Select Case Err.Number

Case = 94
Msgbox "Your Alternative Message Here"
'and any other code

Case Else
'standard error message
Msgbox err.number & err.description
End Select

Resume Exit_MySubsName

The above will show a custom error message when 94 occurs and a standard error message when any other type of error occurrs. This is only a basic use of the error number just used to exemplify the powerful ability to take tailored actions dependent on the error type.


HTH

Ian