I have an Access database connected to excel. I need to find records using Search criteria in recordset from Excel
- Table name in MS Access is
MyTable
with more than 10 columns with data - User enters string data in Excel cell, let us assume
Worksheets("Sheet1").Cells(1, 1)
My need is, macro has to loop through any matching string in column7 and column 10 and copy corresponding recordset in three columns (column1, column7 and column 10) into Worksheets("ALL").Cells(3, 1)…Cells(3,3), etc
Data in column7 and column 10 will have more than 500 character text in one record cell. Search string may present in more than one record cell; hence output will be found in more than one recordset.
Do we have any other option with instr function along with a SQL query?
strSQL = "SELECT Qn_No, Categories, Page_Text FROM MyTable WHERE Categories = '" & str1 & "' or “&Page_Text &"
Any help would be much appreciated. My thanks in advance.