I have a MS Access form where it will ask users to select or type in words that will be used in the where clause for the query. When the button is clicked, it will build the string and use that to run the query. This will be a read only and to view the subset results from a link table in SQL Server. Nothing more. I tried it with DoCmd.RunSQL but that is only for action type like update, delete, etc.
On click button event, it will have similar query. strSQL = "Select top 10 * Where ID = ''" + textbox1.value + "'' from linked_Table_Name;"
This did not work. DoCmd.RunSQL strSQL