try this IF NOT sRain THEN IF InStr(LCase(sRain), "x") > 0 OR InStr(sRain, "-") > 0 THEN fRain=0 ELSE TRY fRain = CFloat(sRain) IF ERROR THEN fRain=-1 'Not a Valid Number ENDIF ELSE fRain=-1 ENDIF