Hi there. I need to created serial numbers for kits being shipped to a customer. They are 19 characters long with the last 4 digits starting at 0001 and ending with the total number of kits that we need to make, which is determined by the quantity in a production order.
On a form I prompt the user for the Production Pick Ticket number and display the Production Order Number, the Kit ID and quantity to make, which I have called QtyToMake, on the open form.
I append the first record into table SerialNumbers with the SerialCountNo starting with 1. I tried to repeat a macro of an append query with a repeat condition using DCount that should stop when the count of how many records in that SerialNumbers table is equal to the quantity to make. No matter how I change the syntax the macro repeats and adds thousands and thousands of records instead of the test quantity to make of 375. It keeps repeating the SerialCountNo, which uses another query to determine the max SerialCountNo and adds 1.
The quantity to make can be anywhere from 50 to 5,000. That means my SerialCountNo could be 0001-0050 or 0001-5000 in those 2 examples.
Does anyone have any suggestions on how to go about this? I sure hope so! I'm pulling my hair out and the customer is waiting!!
Thank you in advance for any help you can give.
Jan
On a form I prompt the user for the Production Pick Ticket number and display the Production Order Number, the Kit ID and quantity to make, which I have called QtyToMake, on the open form.
I append the first record into table SerialNumbers with the SerialCountNo starting with 1. I tried to repeat a macro of an append query with a repeat condition using DCount that should stop when the count of how many records in that SerialNumbers table is equal to the quantity to make. No matter how I change the syntax the macro repeats and adds thousands and thousands of records instead of the test quantity to make of 375. It keeps repeating the SerialCountNo, which uses another query to determine the max SerialCountNo and adds 1.
The quantity to make can be anywhere from 50 to 5,000. That means my SerialCountNo could be 0001-0050 or 0001-5000 in those 2 examples.
Does anyone have any suggestions on how to go about this? I sure hope so! I'm pulling my hair out and the customer is waiting!!
Thank you in advance for any help you can give.
Jan