I am trying to write a query statement in VB code to select all the records with a status of "pending" for the user who is logged on the system (windows logon) and put that on a button to allow the user to run the query. I am able to get the user's logon name using a rule to retrieve the username() but do not know the code to query for only certain records and how to start the query.