J
Julia Boswell
Hi all,
I've searched and haven't found a response on this one, so I wonder if you
can help.
I've got a criteria query called qryFindTrainingDue which looks as follows:
SELECT tblTestTrainingDue.Employee, tblTestTrainingDue.TestTrainingDue
FROM tblTestTrainingDue
WHERE
(((tblTestTrainingDue.TestTrainingDue)=[Forms]![frmMultipleEntry]![txtTraining]));
It works fine.
I'm trying to open it as a recordset to search through using ADO in an
unbound form (frmMultipleEntry). The code is as follows:
Dim db As ADODB.Connection
Dim rsDue As New ADODB.Recordset
Set db = CurrentProject.Connection
rsDue.Open "qryFindTrainingDue", db, adOpenKeyset, adLockOptimistic
When the code runs, I get the error message -2147217900 Invalid SQL
Statement, expected DELETE, INSERT, PROCEDURE, SELECT or UPDATE.
Can anyone give me any clues where I'm going wrong?
Thanks
Julia
I've searched and haven't found a response on this one, so I wonder if you
can help.
I've got a criteria query called qryFindTrainingDue which looks as follows:
SELECT tblTestTrainingDue.Employee, tblTestTrainingDue.TestTrainingDue
FROM tblTestTrainingDue
WHERE
(((tblTestTrainingDue.TestTrainingDue)=[Forms]![frmMultipleEntry]![txtTraining]));
It works fine.
I'm trying to open it as a recordset to search through using ADO in an
unbound form (frmMultipleEntry). The code is as follows:
Dim db As ADODB.Connection
Dim rsDue As New ADODB.Recordset
Set db = CurrentProject.Connection
rsDue.Open "qryFindTrainingDue", db, adOpenKeyset, adLockOptimistic
When the code runs, I get the error message -2147217900 Invalid SQL
Statement, expected DELETE, INSERT, PROCEDURE, SELECT or UPDATE.
Can anyone give me any clues where I'm going wrong?
Thanks
Julia