Chapter 6. Managing Data

The point of a database program is to manage data. Although Access provides most of the tools you’ll need, there are many tasks for which you have to roll your own solution. This chapter concentrates on working with data in ways that traditional database operations don’t support. You’ll learn how to search for records phonetically, back up your database objects, perform lightning-fast finds on linked tables, save housekeeping information, and more. All the examples in this chapter use some form of Visual Basic for Applications (VBA) code, but don’t worry—they are all clearly explained, and “testbed” applications are supplied to show you how each technique works. We present more tips for working with data in Chapter 14, focusing on techniques you can use when your data is stored in SQL Server, rather than in an Access Jet database (an .MDB or .MDE file).

Save with Each Record the Name of the Last Person Who Edited It and the Date and Time

Problem

Your application is used in a multiuser environment with users regularly adding and editing records. Access keeps track of when an object was created and last modified. However, it does not track this information at the record level. With each record, you want to log who created the record, who last edited the record, and the date and time associated with each of these actions. Is this possible?

Solution

Access has no built-in feature that records who edited a record and when the edit was made, but it’s fairly easy ...

Get Access Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.