In your example the variable is treated as a column
Select *
From Table1
Where Name= name
name=name is always true, all records are selected
To use the contents of a variable:
strSQL = "Select * From Table1 Where Name='" & name & "'"
set rs = db.openrecordset(strSQL)
============================================================
'C' is shorthand for Confusion, 'C++' much more confusion...