This class continues our exploration of Macros and
Event Handling. We will begin by creating separate BILL
TO and SHIP TO addresses in our database. So
far, we just have the one address: the customer's main address. What
happens if they want to ship their order somewhere else? What happens if
they move? Now all of their orders look like they went to the OLD
address. So, we'll learn about the importance of storing
Historic Data. Where the order went at the time it was placed
is important and requires additional handling. We'll make a "same as
billing" check box so we don't have to type in the same address twice. A
nice little AfterUpdate macro will handle that.
Next we'll add the BILL TO
and SHIP TO fields to our order form, and our printed
order report. Once the table and forms are set up, the
report is a breeze.
In Lesson 3, we'll learn about one of
Access' limitations: it doesn't support click and drag
(drag and drop). This is something I get asked about ALL
the time. How can I drag items from one listbox to another. Well, there
are 3rd party utilities you can get for that, but I hate using tools
that aren't built into Access (why? I discuss it in class). Anyhow, in
this lesson I will teach you a workaround. Using two listboxes and a
couple of buttons (or a double-click event) I'll show you how to
move items from one list to another. We'll learn about the
RunSQL command and the SQL UPDATE
command.
Finally, we'll learn a few
things that didn't quite fit into another lesson. We'll talk about the
AutoExec macro that will run when your database starts.
We'll learn Error Handling in your macros (so you don't
see those nasty Access dialogs pop up on an error). And, we'll learn
about the Macro Design tab and how to single-step
through macro execution.
This is the 5th class in the Access Advanced series. If you're
serious about building quality databases with Access, and you want to
learn how to automate your database with Macros
and Events, which is a good pre-cursor to 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
Advanced Level
5
00. Intro (3:14)
01.
Separate Shipping Address 1 (14:59)
Add ShipTo Fields
Ship Same as Billing Checkbox
Macro to Copy Billing to Ship Address
02.
Separate Shipping Address 2 (15:21)
Add Fields to Order Table
Copy Ship Bill Fields to Order Form
03.
Move Items Between List Boxes (21:13)
Access Drag and Drop
Limitations
Form Showing Active and Inactive
Employees
Button to Move From Active to Inactive
List
RunSQL Command
SQL UPDATE Command
Put Move Code in On Double Click Event
Click to Preview Employee Record |
04. Miscellaneous (15:03)
AutoExec Macro Bypass the AutoExec Error Handling
Simple Calculator Form OnError Command VAL() Function
Setting 0 on NULL Values Error Submacro Macro Design Tab
Run Button Single Step Toggle
05. Review (5:55) |
|