Create a custom function

Create a custom function

  1. Open a new module.
  2. Declare the function by typing the Function statement.

  3. Type a function name immediately followed by any function arguments in parentheses. For example, the following declaration for the IsLoaded function specifies strFormName as an argument:
    Function IsLoaded(strFormName As String) As Boolean

  4. Add the Visual Basic code that performs the operation or calculation that you want the function to perform.

For more information on the Function statement, click .