• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 21. Taking Charge of Forms > Using Forms to Control Editing and Save Re...

Using Forms to Control Editing and Save Records

In a single-user environment, one might be tempted to think that Access can handle tasks such as saving records in a form, especially when you consider that Access automatically saves the record you are adding or editing as soon as you move the insertion point to a different record, or close the current form. This all changes in a multiuser environment. Do you want two or more users to be able to access the same record simultaneously and save their changes? It depends on what you want to do. Table 21.3 explains the differences in the three RecordLocks property settings on a form.

Table 21.3. RecordLocks Property Settings
Property Value Comments
No Locks 0 This property often is referred to as optimistic locking. It is the default setting. In forms, two or more users can edit the same record simultaneously. If two users attempt to save changes to the same record, Microsoft Access displays a message to the second user who tries to save the record. This user can then discard the record, copy the record to the Clipboard, or replace the changes made by the other user. This setting is typically used in single-user databases or in multiuser databases in which two or more users need to able to make changes to the same record at the same time.
All Records 1 All records in the underlying table or query are locked while the form is open in Form view or Datasheet view. Although users can read the records, no one can edit, add, or delete any records until the form is closed.
Edited Record 2 This property is often referred to as pessimistic locking. A page of records is locked as soon as any user starts editing any field in the record, and stays locked until the user moves to another record. Therefore, a record can be edited by only one user at a time.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint