Validate the numbers to be scanned by barcode such as from 1-100

I would like to set some numbers to be scanned and no other code should be accepted at all, how can I do this?

@ammaar_al_nofaish, this post discussed previously should help you solve your issue: