|
-
Jul 1st, 2004, 08:53 AM
#1
Thread Starter
Hyperactive Member
Why does Sub work but not function
I have a form in my app named frmMain
In the form I have a Sub
Public Sub mySub()
End Sub
and a function
Public Funtion GetValue() as Long
GetValue = 100
End Function
Now when I call mySub from another form, I do something like
Dim frM as frmMain
frmMain.mySub()
And that works fine..
But why can't I get the return value of the GetValue() function?
i.e
Dim frM as frmMain
Dim myValue as Long
myValue = frmMain.GetValue()
It returns an error, object reference not set to instance of an object...
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|