Microsoft Office 2000/Visual Basic Programmer's Guide   

Locking Shared Data with Bound Forms

The easiest way to create a multiuser database solution is to create forms that are bound to tables or queries. You control how Access locks data by setting multiuser options and form properties.

Selecting a Locking Strategy

When you share data with bound forms, you can specify how Access locks records in a form. There are three locking strategies to choose from:

To set the default locking strategy for all new forms in the database, as well as for all editing performed while using Access datasheets, select one of these options in the Default record locking group on the Advanced tab of the Options dialog box (Tools menu). Note that this setting only determines the default for new forms. If you want to set the locking strategy for an individual form, set the form's RecordLocks property to one of these settings, which will override the setting of the Default record locking group in the Options dialog box. You can specify a locking strategy for one, many, or all forms in a database by setting the RecordLocks property of the Form object in code. For more information about the RecordLocks property, search the Microsoft Access Visual Basic Reference Help index for "RecordLocks property."

In addition to specifying a locking strategy, you can set other multiuser options that help you avoid locking conflicts with other users, as described in "Multiuser Settings" earlier in this chapter.

When you share data while using bound forms, Access displays standard messages when locking conflicts occur.