Invalid Declare for Visual Basic procedure
You tried to declare a Visual Basic function in a form. You can declare a Visual Basic function only in a module, and then only if you want to declare a function that has no arguments so it can be invoked without parentheses. If this is the case, declare it in the Declarations section of each module where a reference to the function occurs. You can then refer to the function without parentheses from each module where it is declared. However, you still need to include the parentheses if you refer to the function from a form or from a module that does not contain an explicit declaration for the function. Declarations for Visual Basic Sub procedures are not allowed.