Like built-in functions, user-defined functions can have any number of arguments, including none. You declare the arguments and their types when you define a function.
In user-defined functions, you can pass arguments by reference, by value, or read-only. You specify this for each argument in the Pass By list.
By reference When you pass an argument by reference, the function has access to the original argument and can change it directly.
By value When you pass by value, you are passing the function a temporary local copy of the argument. The function can alter the value of the local copy within the function, but the value of the argument is not changed in the calling script or function.
Read-only When you pass as read-only, the variable’s value is available to the function but it is treated as a constant. Read-only provides a performance advantage over passing by value for string, blob, date, time, and datetime arguments, because it does not create a copy of the data.
Declare whether the first argument is passed by reference, by value, or read-only.
The order in which you specify arguments here is the order you use when calling the function.
Declare the argument’s type. You can specify any datatype, including:
Built-in datatypes, such as integer and real
Object types, such as window, or specific objects, such as w_emp
User objects
Controls, such as CommandButtons
Name the argument.
If you want to add another argument, press the Tab key or select Add Parameter from the pop-up menu and repeat steps 1 to 3.