599CD.com New Access Seminar: Web Data   Collapse Menus
 
 
NEW Access Seminar - Use Access with the Web! dismiss
 
   
 

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

 
 
 
Courses - Microsoft Access 302
Description: Advanced Access
Running Time: 67 minutes
Pre-Requisites: Access 301 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 7/7/2009 to get a FREE upgrade to our 2007 version when released!
 
Microsoft Access 302
Advanced Access Development

Product Table & Form, Select Product From Combo Box, Column Property, GoToRecord, DLOOKUP, Error Handling, More. 67 Minutes.
 

AC302 Major Topics

  • Product Table, Form, Combo Box
  • Select Products From List
  • Combo Box Column Property
  • DoCmd.GoToRecord
  • DLOOKUP Function
  • Basic Error Handling

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

First we'll make a Product table and form so we can pick from a list of products when making an order. We'll learn how to deal with products that are non-taxable, or perhaps taxed at a different rate than normal (for example, clothes in NY state have a different tax rate than most products).

 

Next we'll make a combo box to list all of our products so that we can select a product when making an order. We'll put this in the footer section of our Order Details subform.

 

We will then create a command button that we can click on to get the data out of the combo box and put it up into the order details. You will learn how to use the Column property of a combo box.

 

You will learn how to move the focus to a new record in VB code, and how to set a field value. You will learn how to get data from multiple columns in the combo box.

 

As great as combo box columns are, you can't use them for everything. Next you'll learn about a powerful function called DLOOKUP that you can use to retrieve ANY values from ANY tables or queries in your database.

 

When we're finished with this lesson, we'll have added much more functionality to our order-entry system by allowing the user to select the product from a list of products instead of just typing it into the order.

 

Access 302 Outline
 

1. Product Information
Backup Access 301 Database
Create a Product Table
Non Taxable Products
Sales Tax Override
Put ProductID in Order Details table

2. Product Combo Box
Create a Product Combo
Remember the value for later use
Put Combo in OrderDetails Footer
Command Button to Add Product
Get Data from Combo Box Columns
Combo.Column() property

3. Get Data From Combo Box
ProductCombo.Column()
Move to a new record in VB code
DoCmd.GoToRecord
Accessing data from multiple columns

4. DLOOKUP
What is DLOOKUP
When should you use DLOOKUP
DLOOKUP to get values from tables
Me.Refresh
DLOOKUP Order Tax Rate from CustomerT
DIM a variable in VB
Basic Error Handling
On Error Resume Next
 

 


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 302

Richard on 1/1/2007:  Continue Order Entry, Build Product Table & Form, Combo Box to Select Products, DLOOKUP, More VBA Functions
 Bob on 10/3/2008: Richard.I have learned so much with your series..thanks. However, I'm confused; I add a new customer; then go to orders - I see my new customer name. Then, after adding my products I hit the x to close the window and return to the customer form. I then return to the order form and my order is gone...happens no matter which lesson in 301-305 etc. If I want to really save my order it appears I need to click on the customer combo box and resele [more...]
Richard Rost on 10/3/2008: Bob, I just noticed something interesting, but kind of unrelated. While I was trying to figure out what's happening for YOU, I noticed that there needs to be a Me.Refresh in the "ADD ORDER" button on the CustomerF form. I just added a customer and hit ADD ORDER and did NOT see the customer in the dropdown because the customer record was still dirty (pencil - being edited). Make sure to add a Me.Refresh into that button. I'll add an a [more...]
Bob Veenstra on 10/10/2008: Richard: I got back at this, and after many tries and reloading of the lesson databases - I have been able to reproduce the error. As best as I could remember, here is the sequence. I think it has to do with the problem you addressed creating the order before its ready...thanks for helping: I can send my screen caps if you would like: used the 304 file. 1. Added me.refresh to add button on customerf form per your instructions.  [more...]
Richard Rost on 10/25/2008: Bob, i went through your directions step-by-step and I couldn't reproduce the problem. Did you make sure that you put a Me.Refresh in BOTH the "show orders" and "add new order" buttons? Try deleting all of the orders and order details in the system and start fresh. See if that helps. It worked perfectly for me and I tried it 3 times with the AC304.ZIP database.
Bin Chen on 3/26/2009: Hi Richard, I am having a hard time getting the Dlookup to work on my form per Access 302. I am trying to get the address field (a combobox) on my form to automatically populate by entering the Name. Here is my statment Address = DLookup("Address", "[PatientData Table]", "Name=" & NameCombo). I put this in the Address_AfterUpdate. But it doesn't work. Please help - Bin
Richard Rost on 4/1/2009: Bin, first of all, you wouldn't put this in the Address_AfterUpdate. You can't look up the field you're updating. You'd put this in the Name_AfterUpdate. Second, I strongly recommend AGAINST naming any field "Name." It's a reserved word in Access. Finally, make sure you put quotes around any string in your parameters: "[Name]='" & NameCombo & "'" Hope this helps. If not, follow the lessons again and do exactly what I do.
 
 

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.
 

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?

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   |   Become an Affiliate   |   TechHelp   |   MYOLP   |   Jobs   |   Chat   |   Downloads   |   Handbooks  (Text)   |    Mailing List   |   Lost Passwords   |   Referral Program   |   Online Poll   |   Troubleshooter   |   Corporate / Educational / Government / Non-Profit Sales   |   Message Forums   |   Testimonials   |   Privacy Policy   |   Tips & Tricks

 
 

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