V
vavroom
I am using Split() to display part of the value of a field in a
subform. The subform has a filter to view only those records that have
a field checkbox=true.
This works well as long as I am viewing only the subform
When I view the form with the subform, if a record on the form happens
not to have records with that true checkbox, then I get an invalid use
of null error.
It points to this bit of code:
===
strFileName = Me.PaperConcat
varValues = Split(strFileName, " ")
If UBound(varValues) > 0 Then
lngNumber = CLng(varValues(0))
strPaper = varValues(0)
End If
Me.txtPaper = strPaper
===
I tried including that in its own if/else statement, checking first to
see if me.paperconcat is null, if it is, do one thing, if it's not,
then run that split routine. But that didn't work (possibly because I
wouldn't have written it properly?
I'm not sure how to modify this code to handle the null value? I guess
what I'd like it to do is that if me.paperconcat returns a null value,
then it should be ignored and txtPaper return display nothing.
subform. The subform has a filter to view only those records that have
a field checkbox=true.
This works well as long as I am viewing only the subform
When I view the form with the subform, if a record on the form happens
not to have records with that true checkbox, then I get an invalid use
of null error.
It points to this bit of code:
===
strFileName = Me.PaperConcat
varValues = Split(strFileName, " ")
If UBound(varValues) > 0 Then
lngNumber = CLng(varValues(0))
strPaper = varValues(0)
End If
Me.txtPaper = strPaper
===
I tried including that in its own if/else statement, checking first to
see if me.paperconcat is null, if it is, do one thing, if it's not,
then run that split routine. But that didn't work (possibly because I
wouldn't have written it properly?
I'm not sure how to modify this code to handle the null value? I guess
what I'd like it to do is that if me.paperconcat returns a null value,
then it should be ignored and txtPaper return display nothing.