This class continues our look at programming in Visual Basic for
Applications in Microsoft Access (VBA, or Access VB). We will
focus primarily on adding partial payments to invoices. If you have a
situation where invoices are not paid all at once, this will be of
particular interest to you. However, even if this is not the way your
business operates, you will still find the techniques taught in today's
class to be valuable. We will start by creating tables for our data:
PaymentT, PaymentMethodT, and a form to view payments, PaymentF. We'll
review form footer totals and the SUM function, the DSUM function, popup
and modal forms. We'll learn how to refresh a subform
in VBA, and how to refer to a field on a subform with
Forms!FName!Subform.Form!Field notation.
Next we'll learn about
different MsgBox options, including vbExclamation,
vbCritical, and vbInformation. We'll make it so that a user can't add a
payment if the invoice is already PAID, or if it's only
a Quotation. We'll add the payment information to the printable invoice,
so the user can see the total amount paid and the amount due. We'll use
the NZ function to handle a situation where there are
no payments (zero, instead of a Null value).
We'll add a horizontal
line to our totals area, and we'll see how we can hide
that line in addition to the Payments Made field and label if there are
no payments. We'll learn how to work with the Build Event of the Report
Footer Section. We'll see that there is a problem with the Can
Shrink property when it comes to invisible fields and labels,
and we'll see how to work around it. We'll learn how to deal with
duplicate field names in queries, and what to do when a reference in a
formula could refer to more than one field.
This is the 7th class in the Access Developer series. If you're
serious about building quality databases with Access, and you want to
learn how to automate your database with VBA Programming then don't miss out on
this course. Of
course, if you have any questions about whether or not this class is
for you, please contact me.
Complete Outline - Access
Developer Level
7
00. Intro (3:24)
01.
Partial Payments 1 (30:54)
Create PaymentT
Create PaymentMethodT
Create PaymentF
SUM in Form Footer PaymentTotal
DSUM Payment Total
Popup, Modal Forms
Refresh Subforms
Forms!FName!Subform.Form!Field
Notation
02.
Partial Payments 2 (13:36)
vbExclamation
vbCritical
vbInformation
Don't allow Payment if PAID
Don't allow Payment if QUOTATION
Add Payments to Invoice Report
If No Payments, Handle NULL Value
NZ Function |
03. Partial Payments 3 (22:29)
Add Horizontal Line over Payments Hide Payments, Due if Null
or Zero CTRL-Y to Delete Line of Code Visible Property
Section Header Build Event Code Can Grow, Can Shrink for
Section Header Can Grow, Can Shrink for Text Boxes Labels
Don't Shrink IsQuotation Not In Subform Duplicate Fields
in Both Tables Specified Field Could Refer Refer To More
Than One Table Add IsQuotation to OrderDetailQ
04. Review (2:35) |
|
Keywords:
Access VBA, Visual Basic for Applications, microsoft access tutorial, microsoft access tutorial, microsoft access training, partial payments on invoices, refresh subforms, form subform notation, NZ function, can grow, can shrink |