Hi Mike, What do you mean by "it fails miserably"? Personally I would probably write that differently because it does look a bit messy with so many len() checks.
Suggestions could be: Use CFSWITCH/CFCASE. Although it would do the same thing as your if statements it would be a lot cleaner and easier to read. Just check the len in the CFSWITCH expression then based on the value load an appropriate case. The cfelse statement at the end could be covered by a CFDEFAULTCASE. Alternatively you could use a CFLOOP which is feed the length of the form.reorder and then adds a set amount of zeros at the start depending on the difference between the starting value and the value 8. For example if the form.reorder is 4 then you would loop over the Order_Number variable four times adding a 0 at the start of each cycle. As I say that's just personal opinion. James ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| ColdFusion 8 beta â Build next generation applications today. Free beta download on Labs http://www.adobe.com/cfusion/entitlement/index.cfm?e=labs_adobecf8_beta Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:282280 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

