List Constants

If the Options window (Editor tab) has a checkmark next to the Auto List Members setting, Visual Basic displays a pop-up menu listing the constants that are valid for the property or method. A constant is a value that indicates a specific state or result. Access and other members of the Microsoft Office suite have some predefined, built-in constants. Suppose you want to open a form in Design view. In Microsoft Access, a form can be viewed in: Design view (acDesign), DataSheet view (acFormDS), PivotChart view (acFormPivot-Chart), PivotTable view (acFormPivotTable), Form view (acNormal), and Print Preview (acPreview). Each of these options is represented by a built-in constant. Microsoft Access constant names begin with the letters ac. As soon as you enter a comma and a space following your instruction in the Code window (e.g., DoCmd.OpenForm "Products"), a pop-up menu will appear with the names of valid constants for the OpenForm method.

Figure 2-11: The List Constants pop-up menu displays a list of constants that are valid for the property or method typed.

The List Constants menu can be activated by pressing Ctrl+Shift+J or by clicking the List Constants button f^J on the Edit toolbar.

0 0

Post a comment