Applies To Form object, QueryDef object, TableDef object.
Description
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.
Note The DatasheetFontName and DatasheetFontHeight properties apply to all fields in Datasheet view and to form controls when the form is in Datasheet view.Setting
You can set these properties by selecting the font name from the Font box or font size from the Font Size box on the Formatting (Datasheet) toolbar.
|
|
| DatasheetFontItalic* |
|
|
|
|
|
|
See Also BackColor property, DatasheetBackColor, DatasheetForeColor properties, DatasheetCellsEffect property, DatasheetFontItalic, DatasheetFontUnderline properties, DatasheetFontWeight property, DatasheetGridlinesBehavior property, DatasheetGridlinesColor property, FillColor property.
Example The following example sets the font to MS Serif, the font size to 10 points, and the font weight to medium (500) in Datasheet view of the Products table. To set these properties, the example uses the SetTableProperty procedure, which is shown in the DatasheetFontItalic, DatasheetFontUnderline properties example.Dim dbs As Database, tdfProducts As TableDef
Set dbs = CurrentDb
Set tdfProducts = dbs!Products
SetTableProperty tdfProducts, "DatasheetFontName", dbText, "MS Serif"
SetTableProperty tdfProducts, "DatasheetFontHeight", dbInteger, 10
SetTableProperty tdfProducts, "DatasheetFontWeight", dbInteger, 500
The next example makes the same changes as the preceding example in Datasheet view of the open Products form.
Forms!Products.DatasheetFontName = "MS Serif"
Forms!Products.DatasheetFontHeight = 10
Forms!Products.DatasheetFontWeight = 500