DatasheetGridlinesBehavior Property

DatasheetGridlinesBehavior Property

See Also                  Applies To

You can use the DatasheetGridlinesBehavior property to specify which gridlines will appear in Datasheet view.

Notes   This DatasheetGridlinesBehavior property applies only to objects in Datasheet view.

This property is only available in Visual Basic within a Microsoft Access database (.mdb).

Setting

The DatasheetGridlinesBehavior property uses the following settings.

Setting Visual Basic Description
None acGridlinesNone (0) No gridlines are displayed.
Horizontal acGridlinesHoriz (1) Only horizontal gridlines are displayed.
Vertical acGridlinesVert (2) Only vertical gridlines are displayed.
Both acGridlinesBoth (3) (Default) Horizontal and vertical gridlines are displayed.

You can set this property by using the Gridlines button on the Formatting (Datasheet) toolbar, and in an Access database (.mdb), by using a macro, or by using Visual Basic.

The following setting information applies to both Access databases (.mdb) and Access projects (.adp):

You can also set this property by selecting the settings displayed under Gridlines Shown in the Cells Effects dialog box, available by clicking Cells on the Format menu.

You can set the default DatasheetGridlinesBehavior property by using the settings under Default Gridlines Showing on the Datasheet tab of the Options dialog box, available by clicking Options on the Tools menu.

Remarks

Changes to this property will be visible only if the DatasheetCellsEffect property is set to Flat.

The following table contains the properties that don't exist in the DAO Properties collection of until you set them by using the Formatting (Datasheet) toolbar or you can add them in an Access database (.mdb) by using the CreateProperty method and append it to the DAO Properties collection.

DatasheetFontItalic* DatasheetForeColor*
DatasheetFontHeight* DatasheetBackColor
DatasheetFontName* DatasheetGridlinesColor
DatasheetFontUnderline* DatasheetGridlinesBehavior
DatasheetFontWeight* DatasheetCellsEffect

Note   When you add or set any property listed with an asterisk, Microsoft Access automatically adds all the properties listed with an asterisk to the Properties collection in the database.