Passing Table Values into a TVF
The error you're getting is that you are using an alias that is defined after the table you're currently referencing. In this instance, you will need to change the order of your tables as mentioned by Mark in the comment.

You can use a CROSS APPLY which is more similar to an INNER JOIN, or you can use an OUTER APPLY which is more similar to an OUTER JOIN. 
Based on the syntax of your query above, my guess is that you are wanting a CROSS APPLY.

To echo Mark,

FROM dbo.Users AS u
CROSS APPLY dbo.UserData(u.UserID) AS data