Free Lessons
Fast Tips
Topic Index
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
Home > Courses > Access > Developer > D25 > < D24 | D26 >
Access Developer 25

ByRef, ByVal, ActiveForm, Control, Product Groups

 S  M  L  XL  FS  |  Slo  Reg  Fast  2x  |  Bookmark Buy Now


In this class I cover the ByRef and ByVal keywords for passing values to subs and functions. I'll teach you how you can use ByRef to have a function return multiple values from a function. We'll learn about ActiveForm and ActiveControl so that you can see which form and which field are currently active allowing you to change its value. We'll add product groups to our invoicing system. We built an invoicing system back in Developer 23. In this level we're going to add product groups so you can group stuff together in packages so instead of adding 10 line items every time someone wants to buy one of your bundles you just pick it once and then BOOM! all that goes right up into the order.


Topics Covered

In Lesson 1, we're going to learn the difference between passing values ByRef or ByVal to your subs and functions. We're going to build an increment subroutine where we send it a variable X and have it increment by one.

In Lesson 2, we are continuing with ByRef or ByVal. We're going to send some optional parameters to our function so you can say "I want to increment by 7 or ten instead of just one." I'll show you how to use it with form controls so you can put a field on a form and use your subroutine with that. Then we'll determine if it's a field or a number that we're working with and then of course we'll talk about public subroutines and functions which we have covered in previous classes so this would be a good review.

In Lesson 3, we're continuing with ByRef or ByVal. We're going to learn how to use ByRef to have a function return multiple values. Up until now functions have always returned one value: a boolean, a string, or whatever. In this lesson, I'm going to show you how to have a function return multiple values. We're going to return a status code. We're going to return whether or not a ticket is valid. That's the true/false. Then we'll return a status code, like the first character is not a "T" or whatever our validation rule happens to be. Then we'll also return a third value. We'll look up the customer's name and return that too. This is really cool stuff!

In Lesson 4, we're going to learn about the ActiveForm and the ActiveControl. We're going to learn how to determine what form and what control the user is currently on so we don't have to send it as a parameter to a function. Then we'll learn how to access the previous control so if you want to use a button, say you want to click on a field and then hit multiply by 10, the button can then figure out where the user came from. What was the previous control you were on? tThen instead of sending the name of the control we're going to actually dim a control itself as an object variable and learn how to work with different control types.

In Lesson 5, we're going to build product groups. What's a product group? Well if you sell products that you want to bundle together and put a package together then you can create a product group. Now, when you go to put an order in instead of having to say "I want this part this part, this part, this part," and manually pick them all, you just pick the product group. Then in the next lesson, lesson 6, we'll click one button and it will automatically add the group and put all the line items in for you.

In Lesson 6, we're going to take the product groups that we built in lesson five we're going to add a combo box under our order form so you could pick a product group. It will add the product group up top into the order using a Recordset loop. Of course we're going to then go to the invoice. We're going to hide all the $0.00 items because you don't want to show zeros for all the items that are in the group.You just want to show the package price. We'll indent those products that are zeros in the package. We'll bold the package name and then - and you don't see it in the screenshot - but I also add some conditional formatting so those packages will show up in orange.

Enroll Today

Enroll now so that you can 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.


Comments for Access Developer 25
Age Subject From
3 yearsLesson 1 in Dev25Graham Hendricks


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 to Access Developer 25
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.

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

Copyright 2024 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/23/2024 7:53:54 AM. PLT: 1s
Keywords: access developer 25 byval byref activeform active form activecontrol active control product groups packages bundles  Page Tag: whatsnew  PermaLink  Microsoft Access Developer 25