I am getting this error : Microsoft VBScript runtime error '800a005e' Invalid use of Null /Admin/function.inc, line 12 this is my lines from 6-17 for i = 1 to 10000 begstr = "$r$" enstr= "$r$" beg = Instr(1,qstr,begstr,1) + len(begstr) if beg = len(begstr) then exit for en = Instr(beg + 1,qstr,enstr,1) if en = 0 then en = len(qstr) + 1 rstr = mid(qstr,beg,en - beg) qstr=replace(qstr,"$r$" & rstr,"") resp(i)=right(rstr,len(rstr)-instr(1,rstr,"|",1)) the red is line 12 please help me correct this thank you very much! Respectfully Suhaib
Sounds to me that one of the variables being passed to Instr is null, possibly beg. Try putting: if IsNull(beg) Then beg = 0; Before line 12 to ensure that beg isn't null. If it's not beg that is null, test to see which variable IS null (qstr, or enstr). I'm assuming you dont want those variables to ever be null, so either figure out why it's being null (and if this is expected), and deal with the null values, or fix the reason why they're becoming null.