passing null value causes error

edkocol

Registered User.
Local time
Yesterday, 17:38
Joined
Oct 2, 2012
Messages
30
x = Update_Exposure(Me!RecordID, Me!ClientID, Me!Exposure)

Why does the above statement halt with an error:
"Invalid Use of NUll"
when the value of Me!Exposure is in fact null because the memo field Exposure has been blanked out by the user on the form?

Function Update_Exposure(precordID As Long, pclientID As Long, pexposure As String) As Long
 
Because you've declared pexposure as String, which can't handle a Null. If you want to be able to pass a Null, it has to be declared as Variant.
 
DOH!!!!

Thanks for pointing out the obvious.
 
LOL! No problemo.
 

Users who are viewing this thread

Back
Top Bottom