Yes, you will always get the data from the table and not the form. You need to specify the relationship fields in your SQL statement, or in your code. For example:
"SELECT * FROM tblYourTable WHERE [ID] = " & YourID
This will limit the records in your results to those you see in the subform. In fact, that is how the subform limits its records.
Does this help?