Computer Learning Zone CLZ Access Excel Word Windows

The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom.

-Isaac Asimov
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Multiple Unit Prices for A Product
By Richard Rost   Richard Rost on LinkedIn Email Richard Rost   12 years ago

Today's Question of the Day comes from Colin M. He asks:

I need to set up my products unit costs from suppliers for purchase orders, and subsequently, multiple unit prices to my customers with different prices, to be inserted into an order form and invoices, and based upon the quantity that my customer orders.

For instance, Vendor XYZ prices his cost to me for say 100 to 199 widgets at $5.00 each, for 200 to 499 widgets at $4.00, 500 to 999 widgets at $3.00, and so forth. I need to record these in my product table at these costs, along with the corresponding sales price with a different sales price for each quantity range. Calculation of the Sales Price will be calculated outside of  Access in an Excel file.

I have not seen this problem addressed in the Lessons up through Expert Level 25.  Everything in the lessons seems to have just one fixed cost and sale price, regardless of quantity ordered.

Can anyone assist me with this?  Thanks in advance.


Reply from Richard Rost:

Interesting problem. I can't think of an easy NON-programming solution for this, so you'll need a little VBA or a macro when you add a product to your purchase order.

You will need to have a separate table to track pricing for each of your product price breaks. Let's call it ProductPriceT. It would have the ProductID (foreign key) and then a MinQty and Price. So for example, your table would look like:

ProductPriceT
1, 1, $1.99
1, 10, $1.59
1, 50, $0.99
2, 1, $200
2, 100, $150

This says that Product 1 would cost $1.99 in quantity 1-9, $1.59 in quantity 10-49, and $0.99 from 50 and up.

Product 2 would cost $200 for quantity 1 to 99, and $150 for quantity 100 and up.

Now, when you add a product to your purchase order, you'll have to look up the appropriate price from this table using a combination of DMAX and DLOOKUP. You'll need DMAX to find the largest price break equal to or less than the quantity you're ordering, and then DLOOKUP to pull that price. So for example:

LargestPriceBreak = DMAX("MinQty","ProductPriceT","MinQty<=" & QuantityOnOrder & " AND ProductID=" & ProductID)

This will find the largest price break for the product LESS THAN the quantity your ordered, for that particular product. So if the quantity is 45 and product ID is 1, it should return 10 (largest price break of 45 or LOWER). Now that you have that, you can return the unit cost:

UnitCost = DLOOKUP("Price","ProductPriceT","ProductID=" & ProductID & " AND MinQty=" & LargestPriceBreak

And there you have it. You now have the appropriate unit cost to assign to that line item of your purchase order. You can throw it in your button event that adds the product (like I did in Access Expert 22, Lesson 3).

Very good question. I'm going to make this the Question of the Day and possibly add it to a future class.

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Multiple Unit Prices for A Product
Get notifications when this page is updated
 
 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 4/30/2026 12:25:48 PM. PLT: 0s
PermaLink  Multiple Unit Prices for A Product