DefaultView, ViewsAllowed Properties

Applies To

Form.

Description

You can use these two properties to specify the view a form displays when it opens and whether users can switch to and from Datasheet view and Form view.

  • DefaultView — You can use this property to specify the opening view of a form.
  • ViewsAllowed — You can use this property to specify whether users can switch between Datasheet view and Form view by clicking the Form or Datasheet command on the View menu.

Setting

The DefaultView property uses the following settings.

Setting Description Visual Basic
Single Form (Default) Displays one record at a time. 0
Continuous Forms Displays multiple records (as many as will fit in the current window), each in its own copy of the detail section of the form. 1
Datasheet Displays the form fields arranged in rows and columns like a spreadsheet 2


The ViewsAllowed property uses the following settings.

Setting Description Visual Basic
Both (Default) Users can switch between Form view and Datasheet view. 0
Form Users can’t switch to Datasheet view from Form view. 1
Datasheet Users can’t switch to Form view from Datasheet view. 2


Design view is always available (unless permissions are set otherwise).

You can set these properties in the property sheet, a macro, or Visual Basic.

Remarks

The combination of these properties creates the following conditions.

DefaultView ViewsAllowed Description
Single, Continuous Forms, or Datasheet Both Users can switch between Form view and Datasheet view.
Single or Continuous Forms Form Users can’t switch from Form view to Datasheet view.
Single or Continuous Forms Datasheet Users can switch from Form view to Datasheet view but not back again.
Datasheet Form Users can switch from Datasheet view to Form view but not back again.
Datasheet Datasheet Users can’t switch from Datasheet view to Form view.


See Also

AutoResize Property.