Access 306 continues our advanced Access
database development with VBA programming.
This lesson focuses calculating employee
commission rates and pay rates. Sounds easy? Well we will learn about
all kinds of new concepts like DMax, Me.Requery,
InputBox, nested IIF functions, and much more.
We will calculate an employee's commission
paid based on his commission rate using an IIF function:
We'll learn how to use DMAX to calculate
the commission that he should be paid - based on his sales - according
to our commission table.
We'll create a form to just show Paid Commissions,
Unpaid Commissions, or both. We'll learn the Me.Requery command
to refresh the form results when the box is checked or unchecked.
We'll create a report we can print out to
see all of the commissions our sales reps need to be paid.
We'll make a button that we can then click on to
mark all of the commissions as PAID, and we'll throw in a little
"Are You Sure?" message box prompt.
We'll create a button on our Main Menu form with a
PASSWORD on it. This way someone has to type in the password in
order to open the employee commission form or report.
Next we'll work on employee pay rates.
We'll learn how to calculate regular and overtime hours, which will let
us calculate regular and overtime pay.
Rates based on single rate, based on different rate per employee,
based on order amount. Nested IIF Functions.
paying employees commission based on order amount and separate rates
for each employee. DMax. Using DMax with DLookup to pull a
commission rate based on employee and largest order amount. (Note
DMin is same as DMax but looks up the smallest value)
Me.Requery on opening a form (getting no records because
underlying query is based on a checkbox on the form).
||Commission Report to
group commission amounts by employee. Update query to mark all
commissions paid and track date paid. Using InputBox to ask
for a password when a button is clicked.
Calculating employee pay rates based on employee and dates worked.
Another DMax, DLookup example. Calculating regular and overtime
hours and total pay rates.
||Total Running Time: