Background: We test and send out dielectric rubber gloves to customers in fancy boxes and they are to return the boxes for the next customer's shipment. We like to track the boxes so we can know which boxes are missing, if any.
Form frmOrders
CUST_NUM, text, will have data in it already
ORDER_NUM, text, will have data in it already
SHIP_DATE, date/time, will have data in it already
BOX_NUM_1, BOX_NUM_2, ….BOX_NUM_10, text
RETURN_1, RETURN_2, ….RETURN_10, yes/no
Each shipping box will be equipped with an address card which has has CUST_NUM barcode on it. Each box will also have a barcode for the BOX_NUM_X. We'll be doing two things with our boxes: 1. Shipping. 2. Receiving.
Other helpful info:
-- No customer has ever had an order so large he used all 10 boxes. It’s usually 3 or 4.
--BOX_NUM will have 3 or 4 digits numeric digits.
--CUST_NUM will have 5 numeric digits.
--If you aren't familiar with a scanner, it basically works like a keyboard without having to type keys. It will enter an "ENTER" at the end of each scan.
Shipping
1. I've somehow got to tell Access I'm about to enter some information and Access needs to know where to put it. That's my first major hurdle because I don't have any idea where to begin.
2. Scan barcode. Check number of digits. It is 5 digits. It knows it has just read a CUST_NUM. (The user should always scan the CUST_NUM first.)
3. Look for that CUST_NUM's LastOrder. This might be a start. (thanks topher23, previous post)
4. Scan another number. Check number of digits. It is <5. Access knows it has just read a BOX_NUM. Put the number it just read into BOX_NUM_1 of the LastOrder called up in the last step. Repeat Step 4 (BOX_NUM_2 thru 10) until another 5 digit number is scanned, then start over with Step 1. (At this point Access will have to go to a new record because that's a new customer??)
5. Continue until user goes back to computer and tells Access he is done (btnStopScannin g, Escape, etc)
Here is an example of what I'll be scanning, just for reference. (To simulate scanner with keyboard, type first number, enter, second number, enter, again and again)
The purpose is to get these box numbers into the forms/tables so a box number is linked to an order number which is related to the customer number.
Receiving
1. A BOX_NUM has previously been assigned to a customer in Shipping.
2. Scan the box number. Access should see it is checked out because that value is in a BOX_NUM_1 (1 used for example, could be any value 1-10) with RETURN_1 = No. Each record has a BOX_NUM_1 but only one will contain the value just scanned.
3. Set RETURN_1 = Yes for that BOX_NUM_1 with value matching what was just scanned.
The purpose is to give the customer credit for returning the box.
I’m sure my steps are oversimplified. But I'm trying to contribute and show I am thinking and not just dumping questions on Bytes that have no thought put into how they can be accomplished. The steps are just my idea. Someone else may have a different or better idea (and I'm sure you will, lol). I'm open to all ideas, nothing is off the table, even redesigning tables, etc.
If you can help me or advise me on how I can accomplish what I want to do, please feel free. Thanks in advance.
Form frmOrders
CUST_NUM, text, will have data in it already
ORDER_NUM, text, will have data in it already
SHIP_DATE, date/time, will have data in it already
BOX_NUM_1, BOX_NUM_2, ….BOX_NUM_10, text
RETURN_1, RETURN_2, ….RETURN_10, yes/no
Each shipping box will be equipped with an address card which has has CUST_NUM barcode on it. Each box will also have a barcode for the BOX_NUM_X. We'll be doing two things with our boxes: 1. Shipping. 2. Receiving.
Other helpful info:
-- No customer has ever had an order so large he used all 10 boxes. It’s usually 3 or 4.
--BOX_NUM will have 3 or 4 digits numeric digits.
--CUST_NUM will have 5 numeric digits.
--If you aren't familiar with a scanner, it basically works like a keyboard without having to type keys. It will enter an "ENTER" at the end of each scan.
Shipping
1. I've somehow got to tell Access I'm about to enter some information and Access needs to know where to put it. That's my first major hurdle because I don't have any idea where to begin.
2. Scan barcode. Check number of digits. It is 5 digits. It knows it has just read a CUST_NUM. (The user should always scan the CUST_NUM first.)
3. Look for that CUST_NUM's LastOrder. This might be a start. (thanks topher23, previous post)
Code:
Dim LastOrder As Long
LastOrder = Nz(DMax("ORDER_NUM", "tblOrders", "CUST_NUM='" & Me.CUST_NUM & "' AND ORDER_NUM < '" & Me.ORDER_NUM & "'"), 0)
5. Continue until user goes back to computer and tells Access he is done (btnStopScannin g, Escape, etc)
Here is an example of what I'll be scanning, just for reference. (To simulate scanner with keyboard, type first number, enter, second number, enter, again and again)
Code:
10001 826 10001 1028 10001 1246 10005 1054 10005 896 10008 890
Receiving
1. A BOX_NUM has previously been assigned to a customer in Shipping.
2. Scan the box number. Access should see it is checked out because that value is in a BOX_NUM_1 (1 used for example, could be any value 1-10) with RETURN_1 = No. Each record has a BOX_NUM_1 but only one will contain the value just scanned.
3. Set RETURN_1 = Yes for that BOX_NUM_1 with value matching what was just scanned.
The purpose is to give the customer credit for returning the box.
I’m sure my steps are oversimplified. But I'm trying to contribute and show I am thinking and not just dumping questions on Bytes that have no thought put into how they can be accomplished. The steps are just my idea. Someone else may have a different or better idea (and I'm sure you will, lol). I'm open to all ideas, nothing is off the table, even redesigning tables, etc.
If you can help me or advise me on how I can accomplish what I want to do, please feel free. Thanks in advance.
Comment