Intrinsic and Named Constants

As noted earlier in this chapter, VBA and Access have many predefined intrinsic constants. The names of these constants are considered keywords because you cannot use these names for any purpose other than returning the value represented by the names, such as -1 for True and Yes, and 0 for False and No. (True and Yes are Access synonyms, as are False and No, so you can use these pairs of values interchangeably in Access, but not in VBA.) As noted throughout the chapter, Null indicates a field without a valid entry. True, False, and Null are the most commonly used VBA intrinsic constants.

T-SQL

T-SQL uses 1 for TRUE and 0 for FALSE. Conversion between -1 for True and 1 for TRUE succeeds because True accepts any non-0 number as Not False. The Upsizing Wizard converts Jet Boolean fields to the SQL Server bit data type.

Symbolic constants, which you define, return a single, predetermined value for the entire Access session. You can create named constants for use with forms and reports by defining them in the declarations section of an Access VBA module. Chapter 27 describes how to create and use symbolic (named) constants.

To find the constants that are built into Access, see "Symbolic Constants," p. 1167.




Special Edition Using Microsoft Office Access 2003
Special Edition Using Microsoft Office Access 2003
ISBN: 0789729520
EAN: 2147483647
Year: 2005
Pages: 417

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net