Foriegn keys are used to join tables in queries. Join
In your case your explanation indicates that you have a many-to-many relationship between users and tasks: "for any users who has 'Task 1'
".
You may be saying that table #2 is a matrix that links to a further tasks table, in which case your design works so long as you know how to use it.
If it just users and tasks, 2 tables, then you have to change your design: create a table that breaks the relationship down into 2 one-to-many relationships.
Technically, you should do this through 2 sunsiduary tables; each resolves one side of the many-to-many relationship. The 2 tables are then joined in a one-to-one relationship through multi-column indexes.
I just over-lay the 2 into 1; AND REMEMBER THE LIMITATIONS. You cannot go from multiple users to multiple tasks. You cannot join all 3 tables in the same query. If you do then calculated or aggregated fields will be dodgy at best.
If you want all user costs for a task then you join the matrix to the users table and pass them the task id. Likewise for all tasks a user has. Nested queries or temp tables are used for aggregate functions, summary reports, etc.