Displaying values from one table based on text box value of a different table

I have a form that has a text box that displays a unique number. I want to use that number to display values from another table that also has that unique number. I'm using this code, but it displays no value:
SELECT * FROM financial WHERE ((spatientnumber) = 'textarea2.value');

Hi and welcome to the community,

It looks like you're trying to run a query with a dynamic value. To do that you'll need to use curly brackets to reference the component and its value, not a string as you have now.

Thanks... so I tried:
SELECT * FROM financial WHERE ((spatientnumber) = {textarea2.value});

and I get.... "syntax error at or near "{""

I've also tried it with 2 curly brackets and get the same error.

SELECT * FROM financial WHERE spatientnumber = {{textarea2.value}};

Again, thanks, but I get this error now:

ReferenceError: Can't find variable: textarea2

Any chance you can post some screenshots?

I'm trying to get Table2 to pull data from the Financial table using "Record" number to filter the data retrieved.

You are only trying to get data from financial for the selected row in the first table or all rows in the first table?
If all rows use
select * from financial where apatientnumber IN(table1.data.thecolumnnamefromtable1)
If one row
select * from financial where apatientnumber = table1.selectedRow.data.thecolumnnamefromtable1

Thank you Scott... that worked.