Defining how many times to loop.

TobyMace

Registered User.
Local time
Today, 02:22
Joined
Apr 13, 2018
Messages
65
I'm not at all familiar with looping in VBA so I may need to waffle...

I am looking to create a form that, when opened, asks for a "Date", "Quantity" and "Serial number(s)" all in separate input boxes preferably.
How do I accomplish this so that the number of input boxes that appear for "Serial numbers(s)" = the value in "Quantity". The value in "Quantity" can vary each time. "IDD_Number" will be the same for all of those "Serial Number(s)". The "Serial Number(s)" will not be sequential.

I have a list of "IDD" Numbers starting at 18000.
So the first entry is made of 4 serial numbers and all of those have 18000.
Then the next entry of 8 serial numbers to have the IDD number 18001.
And so on.

Once that has been accomplished I want the "IDD_Number" and "Date" to be entered in the corresponding fields against those "Serial Number(s)" in Table "IDD_T". The table will already have the "Serial Number(s)

Make any sense?
Thanks in advance for any help!
 
Or use a form with a sub form for the serual numbers.
 
Hi Uncle Gizmo!

I have come across your "Create Many Records" before actually and really helped me with one of my projects so thank you very much for that!
The only issue I have for this case is that the "Serial Number(s)" won't necessarily be sequential. The Serial Numbers will be entered by barcode scanning.
A way that would make sense for staff here and keeping it easy for them, in my eyes, would be to ask for "IDD Number", "Date", Number they are "IDD'ing" or "Quantity" , and then ask for the "Serial Number(s)" they are scanning in and it'll ask for the same number as defined in "Quantity".
 
That was a method I considered but I would prefer the "IDD Number" to almost be an auto number field but for each set of serial numbers. So 18000 for the first set of 10, 18001 for the next set of 4 for example. I'd rather not have my user's looking up the last IDD number and entering it manually as this is very susceptible to human error.
The "Serial Number(s)" are the only fields to be entered by barcode.
Also the serial numbers do already exist in a table so was hoping I could do some sort of lookup function to find the Serial Numbers entered, "123456" and "123459" for example and enter the IDD Number and date next to it.
I am finishing up for the weekend shortly so will look through your methods next week and see if I can use them in some way.
Thanks for all your help and sticking with me! I'll get back to you to let you know how it's going.
 
I managed to find away around this using an excel spreadsheet (we have to fill this anyway) and by typing the IDD_Number number is able to find the file and gather all the information needed. Thanks for sticking with me!
Anyone reading this looking for answers I would highly recommend checking out the links supplied by Uncle Gizmo above. Some brilliant stuff there!
 

Users who are viewing this thread

Back
Top Bottom