How do I declare a field in my query as a variable?
And my current database as the record set?
Here is what I am trying, in MSAccess2000....and it isn't working:
Private Sub Command4_Click()
Dim Db As DAO.Database
Set Db = CurrentDb
Dim rst As DAO.Recordset
Dim fld As DAO.Field
Set rst = Db.OpenRecordset("NameOfMyDatabase", dbOpenForwardOnly, dbReadOnly)
While Not rst.EOF
'Open the database
'Set Db = DBEngine.OpenDatabase _
' (".\NAMEOFDB.mdb"

'Open the Recordset
Set rst = Db.OpenRecordset _
("SELECT * FROM MyTblName " &
"WHERE (MyFIELDNAME = 'AnyFieldName' "

, _
dbOpenForwardOnly, dbReadOnly)
This is not working.
Thanks.
Robert