599CD.com Access Imaging Seminar Done   Collapse Menus
 
 
NEW Courses - Access Imaging, Excel 2007 Level 5 dismiss
 
   
 

What's New?  |  Courses  |  Theater  |  Demo  |  Tips  |  Blog  |  Forums  |  Search  |  Help  |  Order

 
What do you want to learn today? 
 
 
Courses - Microsoft Access 303
Description: Advanced Access
Running Time: 77 minutes
Pre-Requisites: Access 302 very strongly recommended
Versions:
We use Access XP in this course, but the lessons are valid for all versions of Access from 95 to 2003. There are cosmetic changes in Access 2007. Order before 3/15/2010 to get a FREE upgrade to our 2007 version when released!
 
Microsoft Access 303
Advanced Access Development

Order List Form, On Double Click Event, Bill-To, Ship-To Addresses, Public & Private Subroutines, Missing Orders, More. 77 Minutes
 

AC303 Major Topics

  • Order List Form
  • On Double Click Event
  • Bill-To, Ship-To Addresses
  • Public v. Private Subroutines
  • Missing Orders

Access 303 continues our advanced Access database development with VBA programming. We continue work on our sales and order-entry system.

We will begin by creating a form to show all orders, and all orders for a specific customer.

 

Next you will learn how to deal with a problem that comes up if the user tries adding a product when there is no order yet. We'll also see how to force the user to select a sales rep first.

 

We will next learn how to double-click on the customer name to open up that customer's record using the On Double Click event. I like to make these kinds of fields blue. We'll also make a double-click event to open a specific order too.

 

In previous Access classes, I taught you that you should almost never store duplicate data in your database - like storing the customer's address on every order since you can just look that up from the customer table. Well, here's one exception: when you want to track history. For example, when this order was shipped, it might have gone to a different address. In this lesson we'll address that with Bill To and Ship To addresses for each order.

 

You can make the addresses different, but I'll show you how to copy them from one to the other if one is blank (the ship-to address will default to the bill-to unless you change it).

Next we'll use our DLOOKUP function from the last class to lookup the billing and shipping addresses from the customer table and automatically fill them in to the order form when a customer is selected.

 

It's starting to look like a real order-entry system now.

 

Next you'll learn how to create your own subroutines in VB code so that you can reuse code without duplicating it. You'll learn about public and private subs and what the difference is.

 

You'll learn how to call subroutines from inside your code, and how to access public subroutines from a different form. Very cool stuff.

 

Next we'll see how to deal with a problem when your user doesn't select a customer for an order. You need to adjust your query join types to show ALL orders, and matching customer records if they exist.

 

Access 303 Outline
 

1. Order List Form
Create a Form to Show All Orders
Deal with adding a product when no order exists
Force user to select a sales rep
Create OrderListQ with LineTotal

2. On Double Click
Double-click on Customer to open Customer record
On Dbl Click Event
Always Use Event Procedures
Command Button to OpenForm Without Wizard
Double Click Event to Open Specific Order

3. Bill To & Ship To Address
Why Store Duplicate Data
Bill To / Ship To Addresses for Customers / Orders
Automatically copy one to the other if blank
Fix tab order

4. Subroutines
DLOOKUP Both Addresses on Order Form
Add New Order Button
acFormAdd
Create Your Own Subroutine
Private v. Public Subroutines
Calling Public Subs from a Different Form

5. Missing Records
DLOOKUP SalesTaxRate for Orders
Fix Joins in OrderListQ
Show All Orders even if Missing a Customer
 

 


Try a FREE Demo Lesson

 
 

Huge Discounts Available
When you purchase multiple classes together
Huge savings up to 50% off! Order Now.
 

Student Interaction: Microsoft Access 303

Richard on 1/1/2007:  Creating an Order List Form, On Dbl Click, ShipTo, BillTo, Creating Subroutines, Public v. Private, Get Sales Tax
J Finley on 6/6/2008: Hi, Firstly may i just say how helpful these tutorials are! Thanks to these unique learning opportunities, i have made some great progress with access. I was just wondering if it was possible to automatically populate and update database field with data from the internet? For example, if i want to check the progress of a share price or an order? Thanks for your help Jay
Richard Rost on 6/13/2008: Jay, YES it's possible - ANYTHING is possible with Access - but it will involve some programming and use of the Internet Explorer object. I do have databases myself that use this (in fact, the very program that pulls down 599CD orders from my web site into my Access database uses this technique) but it's not a quick or simple solution. I do plan on covering this in a future lesson - I'll get to it quicker if more people are interested (speak up!).
 veenstra470@optonline.net on 10/3/2008: Followup - I can't always get the same error...I an thinking that by testing - I deleted the product items - then going back and adding - may have caused the strange results...there is a lot to this..
Thokozani Ginindza on 1/9/2009: firstly i would like to say how helpfull this tutorials are and i wanna say thank you. i have a problem writing code for update querries and as much as making the update querries themselves so may you just outline for me.thanks
Richard Rost on 1/20/2009: Thokozani, I cover Update Queries in detail in Access 222: http://599cd.com/site/courselist/access/access222
Yoshiko on 2/9/2009: 16:10...Command83Button does not work.I can open a new order of a customer shown on CustomerF correctly,but SalesRepID is not shown on a new order,SalesRepID is left blank.Address is shown correctly. After I change VB code of GetCustomerAddress into SalesRepCombo = "SalesRepID","CustomerT","CustomerID="&CustomerCombo instead of SalesRepID = "SalesRepID","CustomerT","CustomerID="&CustomerCombo it does work! Name of Combobox is SalesRepCombo(301-3.4:00...) and Controlsource is SalesRepID. Left hand side of "=" should be Name of Combobox? Or Controlsource of Combobox?
Greg Paradise on 3/11/2009: How important are the spaces in VBA?
Greg Paradise on 3/11/2009: How do you highlight a word so fast? Keyboard shortcut?
Richard Rost on 3/12/2009: Very. You can't use spaces in things like variable names, and if you use spaces in your table or field names you have to remember to enclose everything in square brackets. Something that should be simple like: Forms!CustomerF!FirstName Now becomes a pain if you have spaces in it: Forms![Customer Form]![First Name]
Richard Rost on 3/12/2009: Generally to highlight a single word I just double-click on it.
 
 

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

 

 

Need Help
 
Do you have questions about Word, Excel, Access, Web Design, or computers in general? Just ask us anything you'd like. Click here for assistance.
 

Get Free Tips & Tricks
 

Join our mailing list today and get information on our Free Tips & Tricks Newsletter including free video tutorials, eBooks, live seminars, and more.

Email:
Name:
Type in the word to the left:
 
Your email will be kept 100% safe and will never be given to 3rd parties.
 


CLICK HERE for a FREE lesson



Order your first 599CD course now.
Your Satisfaction is Guaranteed!


Subscribe to our RSS FeedWhat's This?

599CD on Facebook  599CD on Twitter  Subscribe to RSS Feed  Add to Live Bookmarks  Add to My AOL  Add to MyYahoo  Add to Google Reader or Homepage    hide help

599CD Home   |   Learn More   |   What's New?   |   Contact Us   |   Free Demo   |   FAQs   |   Order Now   |   Affiliate Program   |   TechHelp   |   MYOLP   |   Jobs   |   Downloads   |   Handbooks  (Text)   |    Mailing List   |   Lost Passwords   |   Referral Program   |   Online Poll   |   Corporate, Educational, Government, Non-Profit Sales   |   Message Forums   |   Testimonials   |   Privacy Policy   |   Free Gift CDs   |   Tips & Tricks

 
 

What's New  |  Home  |  Courses  |  Demo  |  Learn More  |  Contact  |  Order