When you edit a record in the database by using Access while
the record is being edited by another user, all the records that are related to
the record are shown as locked. The locked record indicator appears at the
record selector of the record, and you may not edit the
records.
However, if the record does not have any child or related
records, the locked record indicator does not display.
Caution If you follow the steps in this example, you modify the sample
database Northwind.mdb. You may want to back up the Northwind.mdb file and
follow these steps on a copy of the database.
Steps to Reproduce the Behavior
- Start Microsoft Office Access.
- Open the Northwind sample database.
- Delete all rows that correspond to OrderID 10692 from the
[Order Details] table. To do this, follow these steps:
Access 2000, Access 2002, or Access 2003- In the Database window, click Queries
under Objects.
- In the right pane, double-click Create query in
Design view.
- In the Show Table dialog box, click
Close.
- On the View menu, click SQL
View.
- In the SQL View page, paste the
following SQL statement:
DELETE * FROM [Order Details] where OrderID=10692
- On the Query menu, click
Run.
- Click Yes.
- On the File menu, click
Close.
- Click No when you are prompted to save
the query.
Access 2007- On the Create tab, click Query Design in the Other group.
-
In the Show Table dialog box, click Close.
- On the Create tab , click SQL View in the Results group.
- Paste the following SQL statement:
DELETE * FROM [Order Details] where OrderID=10692
- On the Create tab, click Run in the Results group to run the query.
- Close the query without saving it.
- Create a query that is named qrytest to show the order details of the customer with customerID ALFKI.
To do this, follow these steps:
Access 2000, Access 2002, or Access 2003- In the Database window, click Queries
under Objects.
- In the right pane, double-click Create query in
Design view.
- In the Show Table dialog box, click
Close.
- On the View menu, click SQL
View.
- Paste the following SQL statement:
SELECT
Orders.OrderID,
Orders.CustomerID,
Orders.OrderDate,
[Order Details].OrderID
FROM
Orders LEFT JOIN [Order Details]
ON Orders.OrderID = [Order Details].OrderID
WHERE
(((Orders.CustomerID)='ALFKI'));
- On the View menu, click
Properties.
- In the Query Properties window, set the Record
Locks property to Edited Record.
- Close the Query Properties window.
- On the File menu, click
Save.
- In the Save As dialog box, type
Qrytest, and then click OK.
- On the File menu, click
Close.
Access 2007- On the Create tab, click Query Design in the Other group.
-
In the Show Table dialog box, click Close.
- On the Create tab , click SQL View in the Results group.
- Paste the following SQL statement:
SELECT
Orders.OrderID,
Orders.CustomerID,
Orders.OrderDate,
[Order Details].OrderID
FROM
Orders LEFT JOIN [Order Details]
ON Orders.OrderID = [Order Details].OrderID
WHERE
(((Orders.CustomerID)='ALFKI'));
- In the Properties Sheet window, set the Record
Locks property to Edited Record.
- Save the query as Qrytest.
- Double-click Qrytest to run the query.
- Modify the Order Date field for the record with OrderID 10692.
- Start another instance of the Northwind
database.
- Double-click Qrytest to run the query.
- Try to modify the Order Date field for the record with Order ID=10692.
Notice that as soon as you type any characters in
the record, Access stops responding for a while. The duration of this behavior
depends on the number of characters that are typed. However, you cannot modify
the record.