Calling Subroutines
A subroutine declaration has the form:
[Public or Private] SubSubroutineName
(Param1
AsDataType1
, _Param2
AsDataType2
,...)
This is similar to the function declaration, with the notable absence
of the As
ReturnType
portion.
(Note also the word Sub
in place of
Function
.)
Since subroutines do not return a value, they cannot be used within an expression. To call a subroutine named SubroutineA, we can write either:
Call SubroutineA(parameters, . . .)
or simply:
SubroutineA parameters, . . .
Note
that any parameters must be enclosed in parentheses when using the
Call
keyword, but not otherwise.
Get Access Database Design and Programming, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.