Look in the form designer API.
You will need a function that gathers the selected rows in the first table then write them to the second table.
You should call this function just before refreshing the data when the user change the search criteria in your textbox
So onChange of AddUserID, you should call a function that does :
get selected rows of table 1
add these rows to table 2
fetch data for table 1 based on AddUserID
DOC :
ca_fdAddTableRow(formId, _id, values)
Adds a row to the table component. The third argument contains the row data as a JavaScript object, e.g. {'userid':'spadmin','age':'31'}. Object attributes correspond to the _id the table columns and the value of the attributes correspond to the value of the cell in the row. In the case provided the table contains two columns with _ids userid and age. This call will add a row with cells spadmin and 31, ca_fdAddTableRow('myForm','myTable',{'userid':'spadmin','age':'31'}) The newly added row will be automatically selected.
Example
// here col1, col2 and col3 are _ids of the three columns in the table with _id = table
ca_fdAddTableRow('form1','table',{'col1':'a','col2':2,'col3':_.user.id});
ca_fdGetSelectedTableRows(formId, _id)
Returns all selected table rows as JavaScript objects.
Example
var selectedRows = ca_fdGetSelectedTableRows('form1','table');
var numSelectedRows = selectedRows.length;
// get the value of the user column (column _id = user) in the first selected row
var firstUser = selectedRows[0].user