spacepro, neileg's answer is absolutely correct, but I will say it a different way so you will understand the problem he is trying to explain.
You see, right now you are talking about using Access to model something - namely, optimizing a truck load - which is a real-world problem. But you are overlooking the basic requirement that ALL computers have when you are designing an automated solution.
If you cannot do it on paper, you cannot do it in the computer.
I.e. you need to specify the algorithm BEFORE you write the first line of code, or, to put it as gently as I can, you are hosed to tears before you start.
The factors I see here are:
1. Dimensions of the van. Not just cu.ft but height, width, and length. Also weight capacity.
2. Dimensions of EACH PACKAGE. Height, width, and length as well as cu.ft. and weight.
3. When a pallet is involved, dimensions of the pallet in the form of height, width, and length plus cu.ft and weight (superceding the dimensions of the individual components.)
Now you have to do, in essence, a 3-D TETRIS game on seeing how many items you can pile over each square inch (cm?) of your floor space.
Your model MIGHT be something like this:
Create a 2-dimensional array representing your floor space where each entry represents one square inch. The size of the arrays correspond to the length and width of the truck, whole inches only. (Don't try to back down to the quarter-inch. That way lies madness.) OR make it 3-dimensional, with the third dimension the truck number. For each truck, you might have different limits, so maybe the dimensions of the array will be those of the largest truck, but you will not use all of the elements in each sub-set of the array. How you arrange this is your call. I might pre-allocate all array elements outside of the possible dimensions for the truck before I start the allocation process, but what the heck, that's just an opinion.
Each array item is the depth in inches of the stack over that square inch of floor in that particular truck. Now, when you start stacking each box, you decide how you want to stack things. YOU HAVE TO DECIDE THIS. WE CANNOT. (It is, after all, your business, not ours.)
You can choose to sort your load requirements to attack lots of boxes of the same size first. That trivializes some of the issues. So what you do is take a box. Get its length and width and height from your dimensions table.
Select the placement of one corner of the box. Look for the lowest allocated height in the truck floor that has a uniform height over a footprint the size of the box starting from an arbitrary corner of said box.
Allocate the height of the box for every square inch the box will cover. For each load, note the position of the box's corner that you used as a loading reference. For instance, the bottom left rear corner as the reference point. This means you store THREE coordinates.
If the box will cover a fraction of the inch, round that UP no matter how small the fraction. (Remember, you rounded the truck dimensions DOWN to the nearest inch no matter how large the fraction.) This guarantees that your loading supervisor won't cuss you every time s/he has to shoe-horn one more box into place.
OK, with one box placed, you now repeat the process for every box. When the bottom layer of floor is covered, you have started to stack the boxes. Eventually, you run out of space because none of the boxes you want to store can fit. So you start another truck.
Now, you COULD do this a different way if you wish. You can test a box to see if it is the same size as the previous box and if it will fit in the height remaining over the previous box.
The difference between these two approaches is to fill the height first or the floor space first. Just remember, you get to choose the approach. I've given you a hint but by no means the whole packing algorithm.
OK, the report just looks at the dimensions you stored for each box you plan to ship. Those were the position of the chosen corner which includes a height, width, and length coordinate as measured from the same corner of the truck's interior, plus the truck number. To LOAD the truck, sort this by the coordinate corresponding to the length of the truck and load the smallest length coordinates first, showing the width second and the height (stacking order) third, grouped by trucks.
I emphasize that this is only a suggestion and might not be viable for your system. But it might galvanize your thinking about the problem to see how it could be done to suit your actual needs.
By the way, don't expect this to be a fast algorithm once the trucks start getting packed. I hope you have a real CRUSHER of a computer for this problem because you are going to eat your CPU's socks when you run this. The search for the lowest free space for the next box will take a LOT of time the more boxes you have already loaded.
I anticipate some issues that might come up.
For instance, allocating one truck at a time and adding a truck only when you have run out of space for the next box you have to allocate. But you should also not give up totally on the truck you just filled if the boxes don't divide evenly in the required space. If you have smaller boxes, they can become filllers (at least in potential) for the gaps between the top of the last box and the truck ceiling.
Now, there is another issue that you might have to consider - stacking depth requirements. Some boxes might say "stack no more than three boxes high" due to the ability of the box to bear the weight of other boxes above it.
You also have to consider load shifting issues if you stack boxes more than n elements high. This is something between you and the truck drivers.
Another issue is that if your trucks are not uniform in size, then you need to know ahead of time the dimensions of each truck as you allocate it and keep the allowable cu.ft in memory, too.
This is where you will earn your money, I assure you. This is not a trivial problem and has been studied many times with many wrinkles.