Firstly can I say thank you to Shiva for that link. It was really helpful although I am still struggling a little.
From that link I have made myself an expression box and entered in the following Xpath for it:
xdXDocument:GetDOM("tblUsers")/dfs:myFields/dfs:dataFields/d:qryAllUsers/@email1[xdXDocument:GetDOM("tblUsers")/dfs:myFields/dfs:dataFields/d:qryAllUsers/@ID = dfs:dataFields/d:tblOrders/@_customerid]
It still is not working though.
Any ideas?
Keith