Applies To Crosstab query, Form, Select query.
Description
You can use the RecordsetType property to specify what kind of recordset is made available to a form. For example, if you don't want data in bound controls to be edited when a form is in Form view or Datasheet view, you can set the RecordsetType property to Snapshot.
Setting
The RecordsetType property uses the following settings.
Setting | Description | Visual Basic |
Dynaset | (Default) You can edit bound controls based on a single table or tables with a one-to-one relationship. For controls bound to fields based on tables with a one-to-many relationship, you can't edit data from the join field on the "one" side of the relationship unless cascade update is enabled between the tables. | 0 |
Dynaset (Inconsistent Updates) | All tables and controls bound to their fields can be edited. | 1 |
Snapshot | No tables or the controls bound to their fields can be edited. | 2 |
See Also AllowAdditions property, AllowDeletions property, AllowEdits property, Enabled, Locked properties.
Example In the following example, only if the user ID is ADMIN can records be updated. This code sample sets the RecordsetType property to Snapshot if the public variable gstrUserID value is not ADMIN.Sub Form_Open(Cancel As Integer)
Const conSnapshot = 2
If gstrUserID <> "ADMIN" Then
Forms!Employees.RecordsetType = conSnapshot
End If
End Sub