That's perfectly good, except for maybe one question, which after I will ask you after I show you these...
Here are a couple of alternatives, using fewer variables.
zcustrecnum& = 123
IF zcustrecnum&
<= 999999999 THEN
IF zcustrecnum&
< 999999999 THEN
Just for fun, I used the numeric value, rather than converting it to a string length. Now, the important part, how did you dim the data tye for your variable: zcustrecnum? If you are really expecting to run up to 9-digits, you need a data type that won't end up in your string as scientific notation. For instance...
a = 999999999
a% = 999999999 ' Integer data type
a! = 999999999 ' Single data type
a& = 999999999 ' Long data type
a# = 999999999 ' Double data type
Of the data types I listed, only the Long (&) and Double (#) will work for a 9-digit number. There is also _INTEGER64, which would be && and can handle 18-digit numbers.
Check out the data types in the QB64 wiki, if you're not sure what I'm talking about here.
http://www.qb64.org/wiki/Data_typesNaturally, you don't have to use the type suffix if you use DIM or make the variable a TYPE.
Pete