Also, using a function you will only be able to pass back on value. If for some reason you 'have' to use a function you can make those variable public and not even have to pass them at all. As Trey said, if possible it is probably best to use a form method and form properties.
>>Hi. I have a form that contains a command button. The command button contains some code which calls a function with two parameters. One of the parameters is a numeric field and the other is a date. I am drawing a blank on how to call this function and pass the parameters, and the return the value of the two parameters back to the main code. I was going to set up the function as a method on the form, but I can't figure out how to pass in the values and return different values for the same parameters. I know how to pass one, I just don't know how to pass two.
>>
>>Can someone help me?
>>
>>Thanks in Advance
>>
>>Sandi Cassidy
>
>The way to return two values is to pass them in by reference. e.g.
>
MyFunction(@parm1, @parm2)
>
>However, I suggest you make the function a form method and the parameters properties on the form instead.
Everything we see or seems
Is but a dream within a dream - Edgar Allen Poe