Unless the query or tables in question are also used by another open form at the same time, it should work to set the Connect property of the linked tables to the other remote database.
You could also (re)write the query SQL to contain a direct reference to the remote table using the IN syntax...