In addition to Sub procedures, you can also create function procedures that Access uses as custom functions. Each function procedure begins with the line: FunctionName( ) where FunctionName is the name of the function procedure. Within the parentheses, place any variables needed for the calculation of the function. You can learn more about variables from Access's online Help. After statement of the function's name and variables , add VBA commands to calculate the result of the function. The function concludes with the End Function line.
Create a Custom Function