Variables

A

Allen Browne

Pass the variable to the other procedure.

Example:
Function AddEmUp(a as Long, b as long) As Long
AddEmUp = a + b
End Function

Now pass the variables like this:
Sub cmdGetAnswer_Click()
Dim a as Long
Dim b As Long
Dim c As Long
a = 4
b = 5
c = AddEmUp(a, b)
End Sub
 
J

Jo M

Thanks Allen..fantastic.

Allen Browne said:
Pass the variable to the other procedure.

Example:
Function AddEmUp(a as Long, b as long) As Long
AddEmUp = a + b
End Function

Now pass the variables like this:
Sub cmdGetAnswer_Click()
Dim a as Long
Dim b As Long
Dim c As Long
a = 4
b = 5
c = AddEmUp(a, b)
End Sub
 
Top