hi all,
i am a little confused abt function and a public sub .please take a look at the below examples.
vb Code:
Private Sub Command_Click()
Call intO(5, 6)
Debug.Print intO
End Sub
Public Function intO(intL As Integer, intX As Integer) As Integer
intO = intL + intX
Exit Function
End Function
here i get an error on debug.print intO although this can be over come by adding these lines
vb Code:
Private Sub Command_Click()
dim intOut as integer
intOut = Call intO(5, 6)
Debug.Print intOut
End Sub
my question is i am trying to return the value from the public function . but i get errors.. i tried to use the return statement but still i get errors. although i have publicly declared intO as an integer then why do i have to assign it to a variable again?