Please clarify.
Is it the case that you actually have two different "Codes"?
That is what this paragraph suggests.
- "...the item code is a hardcode[d] id from the factory itself..."
- "...the serial unique id case comes up only when stock is added to the shelve.."
Please confirm: Is there a manufacturer's code and also your own inventory code?
If so, I assume (hope, actually) that you have two different fields for each of these codes in the Product table.
And further, I assume that you are
only struggling with your own, unique, serial ID which you create for each item as it is added to your inventory? The existence of a separate manufacturer's code is, therefore, a distraction, is it not? Or is it somehow involved in your attempt to create and manage unique serial numbers?
As others have suggested, there are multiple ways to handle this, from list boxes to continuous forms to coding solutions.
I am not yet clear on what needs to be done, exactly.