As far as I know the global variable must be outside the quote marks. Put that in the parameters area of the function:
ExecuteSQL ( " SELECT surname, firstname FROM staff WHERE staff_ID_pk = ? " ; " " ; "" ; $$current_user)
thanks so much problem solved
That is correct. The variable does not get evaluated inside the quoted query.
an alternative is to concatenate the query:
( " SELECT surname, firstname FROM staff WHERE staff_ID_pk = " & GetAsNumber($$current_user) ; "" ; "" )
but that can get messy if you don't properly single-quote text values. That's why passing in the parameters is best.