Access Developer 42
Parameter Arrays, Product Options (Size, Color, etc.)
Today's class is going to focus first on parameter arrays. These allow you to pass an array of values to a function. This will allow you to pass any number of values to a function even if you don't know how many options there are going to be up front.
Then we are going to look at how to handle order entry involving products that have options. For example let's say you run a clothing business and you have a bunch of shirts in your inventory and each type of shirt can have multiple sizes and colors. We'll see how to handle that today.
In Lesson 1, we are going to learn how to find the maximum value from multiple fields in the same record. For example, let's say you have 3 quiz grades, and you want to find the maximum grade. To do this we're going to use nested IIF functions, which we know how to do. We've done this in the Expert series but this is building up to something cool we're going to do in the next lesson with VBA.
In Lesson 2 we're going to take the example from Lesson 1 in which we found the greatest of three specific values and we're now going to turn it into a function so we can send any number of values to the function - could be 5, could be 50 - using something called a parameter array.
In Lesson 3 we are continuing with parameter arrays. We're going to learn more parameter array rules. We're going to learn how to loop through the items in the area with a For Each loop (instead of a For Next loop). We're going to see how we can pass different things to the array like objects. You can pass a list of fields to the function. We'll learn how to check for an empty array and the nothing value.
In Lesson 4 is a free bonus lesson. If you are a TechHelp member on my website (Silver, Gold, Platinum) then you may have seen this already, but this is the database that I'm going to use for the rest of today's class. So if you've watched this already, feel free to skip to Lesson 5. If you have not watched this, I explain how I build the order entry and invoicing system from my TechHelp videos. It's a simpler version of the order entry system that we build in the developer classes but it's perfect for the lessons that we're going over today, so watch this if you haven't seen it already.
In Lesson 5 we're going to talk about building a database that has products that have options. For example, let's say you're building a clothing database for a clothing company. You've got shirts that might have a size and a color option. So, it's the same shirt, but it's small and red, right? Medium and yellow, and so on. In this database, we're going to build something like that. Now in Lesson 5, I'm going to walk you through my first failed attempt. I was trying to build a "perfect" system where you didn't have to have specific fields for size and color. They could all be in a subtable with different options. And while this solution works, and I could get it to work, it's going to be a data entry nightmare when it comes to managing the inventory. So, we'll talk about that in this lesson.
In Lesson 6 we're going to build some new tables for size and color options. Then we're going to make an actual option table to store each product's options for size, color, price, and quantity on hand. Then we'll build a subform so we can enter all of the options for each product.
In Lesson 7 we're continuing on with the products with options. We're going to update our Order Detail table and subform and add new code so that we can select the product and then pick the product's options. Pick a product, select the options, click the Add button, and Bam! The item is added to the order.
Enroll now so that you watch these lessons, learn with us, post questions, and more!
Please feel free to post your questions or comments below. If you are not sure as to whether or not this product will meet your needs, I'd rather help you before you buy it. Remember, all sales are final. Thank you.
microsoft access, access 2016, access 2019, access 2021, access 365, ms access, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #instruction, #learn, #lesson, #training, #database, parameter arrays, paramarray, array is empty, lbound, ubound, for each, is nothing, products with options, size, color
Subscribe to Access Developer 42
Get notifications when this page is updated