Class TempVars (Access VBA)

The class TempVars represents the collection of TempVar objects. To use a TempVars class variable it first needs to be instantiated, for example

Add

Adds a variable to the TempVars collection.

Add (Name, Value)


Dim strName As String: strName = 
TempVars.Add Name:=strName, Value:=

Arguments

The following arguments are required:

Name (String) - The name to use for the TempVar.

Value (Variant) - The value to store as a TempVar. This value must be a string expression or a numeric expression. Setting this argument to an object data type will result in a run-time error.

Count

Gets the number of TempVar objects in the TempVars collection.


TempVars.Count

Item

The Item property returns a specific member of a collection either by position or by index.

Item (Index)

Index: An expression that specifies the position of a member of the collection referred to by the expression argument. If a numeric expression, the Index argument must be a number from 0 to the value of the collection's Count property minus 1. If a string expression, the Index argument must be the name of a member of the collection.


TempVars(Index:=1)

Remove

Removes the specified TempVar object from the TempVars collection.

Remove (var)

var: An expression that specifies the position of a member of the collection referred to by the expression argument. If a numeric expression, the argument must be a number from 0 to the value of the collection's Count property minus 1. If a string expression, the argument must be the name of a member of the collection.


Dim strvar As String: strvar = 
TempVars.Remove var:=strvar

RemoveAll

Removes all of the TempVar objects from the TempVars collection.


TempVars.RemoveAll