A function returns a value, a subprocedure does not.
Example of a subprocedure
---------------------------------------------
Public Sub Acme()
Dim x as integer
x = 3
Msgbox Prompt:="Value of X = " & x
End Sub
In your code, just call the subprocedure by name, such that:
Public Sub Test()
' This will run the above subproc and display a message box
Acme
End Sub
Example of a function
---------------------------------------------
Public Function Acme() as Integer
Dim x as integer
x = 3
Acme = x
End Function
In your code, just call the function, such that:
Public Sub Test()
Dim intResults as Integer
intResults = Acme()
Msgbox Prompt:="The result from the function is: " & intResults
End Sub
HTH
--
Rob
FMS Professional Solutions Group
http://www.fmsinc.com/consulting
Software Tools for .NET, SQL Server, Visual Basic & Access
http://www.fmsinc.com
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-