Looks right to me but w/o knowing more about your data I cannot be sure. What value is stored in the key.transfer field? Is it one of the values from staff.staff_id or it's something else? Try to change JOIN to LEFT JOIN to see which join doesn't have matches.
>hi
>thank you for your help
>however may be I got something wrong
>should the code be this below
>select distinct staff.staff_id, staff.name, staff.chi_name, ;
> key.key, key.category, key.d_to, key.d_return , ;
> key.transfer, s2.name ;
> from key ;
> JOIN staff ON staff.staff_id=key.staff_id ;
> JOIN staff s2 ON staff.staff_id=key.transfer ;
> where key.category = "ACCESS" ;
> and key.key = thisform.text2.value ;
> order by d_to ;
> into cursor ppp
>
>however no data it can post from this??
--sb--