DatasheetFontName, DatasheetFontHeight Properties

DatasheetFontName, DatasheetFontHeight Properties

See Also         Example         Applies To

You can use the DatasheetFontName and DatasheetFontHeight properties to specify the font and the font point size used to display and print field names and data in Datasheet view.

Notes   The DatasheetFontName and DatasheetFontHeight properties apply to all fields in Datasheet view and to form controls when the form is in Datasheet view.

These properties are only available in Visual Basic within a Microsoft Access database (.mdb)

Setting

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

Remarks

For the DatasheetFontName property, the font names you can specify depend on the fonts installed on your system and for your printer. If you specify a font that your system can't display or that isn't installed, Microsoft Windows will substitute a similar font.

For the DatasheetFontHeight property, the font size you specify must be valid for the font specified by the DatasheetFontName property. For example, MS Sans Serif is available only in sizes 8, 10, 12, 14, 18, and 24 points.

You can set the default DatasheetFontName and DatasheetFontHeight properties by using the settings under Default Font on the Datasheet tab of the Options dialog box, available by clicking Options on the Tools menu.

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 of the database.