1. Home
  2. Computing & Technology
  3. Visual Basic
Using the NotInList Event
    With Barb Garber
Windsor, Canada

From Windsor, Ontario, Canada, Barb asked, "How can I use the NotInList event to automatically update the values in a database!"

Barb and I solved the problem together, and in the process we figured out how to use the NotInList event to make a ComboBox a lot more useful in Access. Here's how we did it!

-----------------------------------------

About.com also has a database focused site at databases.about.com.

This article will focus on the VB .NET language aspects of the Access database. Go to About Databases for more information 'About' building and using databases.

-----------------------------------------

 More of this Feature
• Part 2: The VBA Code for Barb's App
• Part 3: Turning Barb's App Into a Lookup Table
 
 Join the Discussion
Is this the kind of article that helps you?
Let us know!
 
 Related Resources
• About Databases
The About.COM site for Database Programming
• The About Visual Basic VBA Tutorial Series
 

Barb described the program she wanted to write this way:

I have a large collection of information that I use within Girl Guides for crafts, games, and other activities. I want to create a database that will let me know where my information is.

My fields are:

  • ACTIVITY - such as "Litter Game"
  • TOPIC - many activities will use the same "topic" but in other cases I'll want to add a new one. I found an example program that uses NotInList but I can't make it work for me.
  • TYPE - whether the activity is a game, craft, dance, or something else.
  • SOURCE - where I'll find the activity, such as a book.
  • LOCATION - the page number, chapter or sub-file to help me find the information.

NotInList is a little known event in Access VBA that isn't even available in VB 6 or VB .NET! So, for all of you VBA programmers, you have an advantage here.

What Barb needs looks like a standard lookup table. If you've coded these before, you might have created a main form that stores most of the information for your system and a lot of little satellite forms just to maintain each of the lookup tables. The NotInList event will let us use a lookup table without a requirement to create an extra form just to maintain it.

Next page > The VBA Code for Barb's App > Page 1, 2, 3
Explore Visual Basic
By Category
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic

©2009 About.com, a part of The New York Times Company.

All rights reserved.