While writing a Function procedure you must set up a return value. This return value is placed in the a variable that Visual Basic names the with the procedure name as function name.
You can also specify the data type of return value by adding as clause after the function name. If return type of Procedure is Currency the procedure should be named as curCommission()
The return value can be used as follows:
Private Function curCommission(ByVal curSalesAmount as Currency) as Currency
‘Calculate the sales commission
If curSalesAmount < 1000 Then
curCommission = 0
curCommission = 1.5 * curSalesAmount