Function arguments can have the same names, but different values, as variables in the caller. Avoid such uses for clarity, however.
The following rules apply to argument persistence:
- Because simple variable and array arguments are passed by value, their names and values exist only while the function executes.
- Because structures, queries, and objects such as COM objects are passed by reference, the argument name exists only while the function executes, but the underlying data persists after the function returns and can be accessed by using the caller's variable name. The caller's variable name and the argument name can, and should, be different.
Note: If a function must use a variable from another scope that has the same name as a function-only variable, prefix the external variable with its scope identifier, such as Variables or Form. (However, remember that using variables from other scopes directly in your code is often poor practice.)