No code needed – as @Nathan_Sav said a – a quick search will find what you’re after (I find “reference main form from subform” gives the best page at the top – http://access.mvps.org/access/forms/frm0031.htm )
SELECT *
FROM Employees
WHERE [First Name]=Forms![Form1]![txtFirstName] AND
[Last Name]=Forms![Form1]![txtLastName]
txtFirstName & txtLastName are the names I gave to the text controls on Form1.
Edit: Your macro button can then just open the query.
solved Textbox as Input in an SQL Query in Access