On my form I have the following and my where statement does not seem to work. Tried altering () and [] but still nothing.
Private Sub FLJan11_Click()
dim strsql as string
dim db as dao.database
dim rs as dao.recordset
set db = currentdb(focus)
strsql = "select focuslist2011.pol, focuslist2011.customer, focuslist2011.subcntjan11
from focuslist2011
where [focuslist2011.pol]=[forms]![focuslist]![pol]"
set rs = db.openrecordset(strsql, dbopendynaset)
more code for loop and excel below the above code. It is erroring by displaying red on my SQL section.