How to set range Automatic?

Hi All,

I have created one New doc type by name, Label baby carton for sticker
The Filed I have in new Doctype are(customer,From Range,To Range,Month,Year,Item Name,MRP,Quantity)
I have problem with Range,
If I entered In from Range 123456 & 123460, Total 4 sticker will print
My requirement is This Range should be automatic how i can achieve This???(The quantity should be add in last no range)