Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   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

Welcome

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.

Resources

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.

Questions?

Please feel free to post your questions or comments below. Thanks.

 

Comments for Access Developer 25
 
Age Subject From
15 monthsLesson 1 in Dev25Graham Hendricks

 


Back to Access Developer 25
 

Start a NEW Conversation
 
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.
 
Subscribe
 

You may want to read these articles from the 599CD News:

5/16/2022Referential Integrity
5/15/2022Invoicing Member Discussion
5/13/2022Multivalued
5/12/2022Number Field Size
5/11/2022Create Word Document
5/11/2022Export to Word
5/10/2022On Click Event Timing
5/9/2022Invalid Use of Null
5/7/2022Event Handler
5/6/2022Database Title & Icon
 

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
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
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn