M
Marty Newbe
Hi can someone tell me what I am doing wrong.
I am calling a function from within a form. The function is located in
module2.
The values pass to the function fine but the returned value from test2 is
alway 0.
Its probably a fundamental mistake but any help would be appreciated.
Option Compare Database
'Form
Option Explicit
Public Sub get_lib_num_Click()
Dim a, b, z As Integer
a = 5
b = 3
z = test2(a, b)
End Sub
'module2
Option Compare Database
Option Explicit
Public Function test2(ByVal x As Integer, ByVal y As Integer) As Integer
z = x + y
End Function
I am calling a function from within a form. The function is located in
module2.
The values pass to the function fine but the returned value from test2 is
alway 0.
Its probably a fundamental mistake but any help would be appreciated.
Option Compare Database
'Form
Option Explicit
Public Sub get_lib_num_Click()
Dim a, b, z As Integer
a = 5
b = 3
z = test2(a, b)
End Sub
'module2
Option Compare Database
Option Explicit
Public Function test2(ByVal x As Integer, ByVal y As Integer) As Integer
z = x + y
End Function