I modified the sub code to
subprojresult = entersubproj()
but I am still not getting a result. in the function I'm setting a value as
follows:
public function
...
subprojvalue = InputBox(message, title, default)
...
end function
the subprojvalue is a global variable and the result is stored at the end of
the function but gone when it comes back to the sum. any clues as to where
I'm going wrong?
> > IE the result of this call function is a variable that is used in the sub
> >
[quoted text clipped - 3 lines]
>
> Tim F
Rick Brandt - 18 Nov 2006 18:22 GMT
> I modified the sub code to
>
[quoted text clipped - 10 lines]
> end of the function but gone when it comes back to the sum. any
> clues as to where I'm going wrong?
To make a function return a value then within the function you need to set the
value of the function itself. If you are instead setting tha value of a global
variable then you need to refer the the golbal variable in youe calling code...
Call entersubproj
subprojresult = GlobalVariableName
...however; returning straight from the function and eliminating the global
variable would be the better way to do it.

Signature
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com