The $ in the chr$ function or space$ represents a string, that is, it is explicitly specified that the returned string is a string. Access explained that it can store the returned results in a smaller memory, thus speeding up the execution of the program. I don't feel the actual effect. The return value can be a variable, not a dollar sign. Variant versions are more convenient than several states, such as Null.
Darken a as a string.
Dim b as a variant
The following sentence is incorrect. string cannot be directly equal to NULL.
A = empty
And variations can be.
B = empty
Please refer to the article "Returning a String from a Function" in ACCESS 2003.
Returns a string from a function.
Some functions have two versions: one returns variable data type and the other returns string data type. Variant versions are more convenient, because the deformer will automatically handle the transmission between different types. They also allow null values to be sent through expressions. String versions are more efficient because they use less memory.
You can consider using a string version in the following cases:
This program is large and uses many variables.
Write data directly into a random access file.
When a dollar sign ($) is added to the function name, the following function returns the value of the Sting variable. The usage and syntax of these functions are equivalent to variables without dollar sign.
Chr$ ChrB$ *Command$
CurDir$ Date$ Dir$
Error $ Format$ Hex$
Enter $ InputB$ LCase$
Left$ LeftB$ LTrim$
Mid$ MidB$ Oct$
Right$ RightB$ RTrim$
Space$ Str$ String$
Time $ Trim$ UCase$
* Not a variable in all applications.