You are also making the function assume which record to grab. Sergey is right. :)
>I see what you are saying. But in my simple example, there is only one work area. How can the query use another work area?
>
>>You have to pass values as parameters because you cannot make any assumption about work areas that query uses.
>>
Steve Gibson