I started a little project that seemed so simple, I know it can be done but I’m stumped. I may have mucked it up but I figure it can always be fixed.
I am trying to create a simple, little database to prepare invoices for shipping charges for our customers. We charge for 3 different things, hours, mileage and weight. Not all invoices will have all items, might be only one, two or all three. They want to be able to enter the start and stop time for the hours, and have the system calculate the total. Since that is different from the other 2, I set up a table for hours and then one that contains the mileage and the weight. I also have a Custumer & Order table and an hourly rate table, there are currently 4 different hourly rates but there could be more in the future and a piece rate table, for the mileage and the weight. The rate for the weight changes depending on the total weight.
This all seemed to work very well, I have an Order query that pulls together the customer and the Order information, and then 2 other subqueries that pull together the hours & rates and the pieces & rates. I then setup a master Order Form, with a 2 subforms, one for the hours and one for pieces. I couldn’t figure out how to tie my 2 different subqueries together with the Order query, since there may be some Orders that only have hour charges, (and may have more than one type of hour charge, straight time and overtime, for example) some that may only have pieces (mileage & weight) and only some that have both. When I construct a query, it only wants to show the items where everything ties to the Order #, which is my link. For instance, in my test, I have 33 items in the hourly table and 19 in the Piece table but I only get 43 items in the query. Any items from the hourly table with an OrderID that does not match an item in the Piece table, won’t show up.
Because of this, I couldn’t create a calculated field in the query to get total dollars, so I had to use a calculated control on the subforms and forms to get a total for each Order, which doesn’t get stored anywhere and then when I create Reports, I have to calculate everything all over again, which doesn’t always work right and I’m afraid the information may change, so the report is inaccurate.
Sorry if this is so long. I’m sure I’m missing a step here somewhere. If someone can help me out, I sure appreciate it. Thanks.