so this part of the code looks for variable named "var2" in the Shift field but I want it to also look for the variable named "var" in the date field.. bith the variables should be in the same row.
Code:
'set the search variable
var = Sheet1.Range("U2").Value
var2 = Sheet1.Range("R2").Value
Set cnn = New ADODB.Connection ' Initialise the collection class variable
cnn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & dbPath
'Create the SQL statement to retrieve the data from table.
SQL = "SELECT * FROM Scrap WHERE Shift = '" & var2 & "'"