beefwellington
Registered User.
- Local time
- Yesterday, 21:08
- Joined
- Jul 27, 2009
- Messages
- 14
I made a Public Function in a module, called Toolbox, where I wanted to place a lot of reusable code. I have the following function in the module:
I've tried to execute the function these 2 ways:
which returns an error on toolbox.test(anInt), and:
which returns anInt = 0 instead of 6.
I'm not sure what I'm doing wrong here so any help would be appreciated.
Code:
Public Function test(anInt As Integer) As Integer
anInt = anInt + 5
End Function
I've tried to execute the function these 2 ways:
Code:
Dim anInt As Integer
Dim toolbox As Module
anInt = 1
toolbox = Modules!toolbox
anInt = toolbox.test(anInt)
MsgBox anInt
which returns an error on toolbox.test(anInt), and:
Code:
Dim anInt As Integer
anInt = 1
anInt = toolbox.test(anInt)
MsgBox anInt
which returns anInt = 0 instead of 6.
I'm not sure what I'm doing wrong here so any help would be appreciated.