based on the variable names I'm guessing that strDateComp is a string, in that case the line of code
strDateComp = Null
will fail because in VBA you cannot set a string equal to null, you can set it equal to Empty, or a zero length string "", but not null.