TempVar Object (Access)
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

TempVar Object (Access)

Represents a variable that be used in Visual Basic for Applications (VBA) code or from a macro.

Version Added: Access 2007

A TempVar objects provide a convenient way to exchange data between VBA procedures and macros.

Although a TempVar object can be used to store information for use in VBA procedures, it does not have the same funcitonality as a VBA variable.

  • By default, a TempVar object remains in memory until Access is closed. You can use the Remove method or the RemoveTempVar macro action to remove a TempVar object.

  • In VBA, a TempVar object is accessible only to the members of the Access Application object, referenced databases, or add-ins.

  • A TempVar object can store only text or numeric data. TempVar objects cannot store objects.

To refer to a TempVar object in a collection by its ordinal number or by its Name property setting, use the following syntax form:

  • TempVar![name]

Show:
© 2016 Microsoft