taking two inputs; running a loop on them and storing all the in between values to the dataset with the submit button.

Can someone help me with this?
i have a form (inventoryform) linked to dataset (InventoryDataset) with some fields, all the other fields are connected directly to the dataset fields.
but i want two of the user inputs ( #Input3 with start serial number and #input4 with end serial number) to run into a loop. and i want all the rest numbers between #input3 and #input4 to store in a dataset field (SerialNumbers) with all the of the other repeated values connected directly.

for eg if their are 10 serials between #input3 and #input4 for all the 10 serials all of the rest data which is directly connected to dataset from my page will remain same.
how will it be performed pressing a submit button.??