Here’s the code:
[codebox] Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim mySQL As String
mySQL = “Select count(*) from [EditMDS] Where [Form Dln] = ‘” & SelectedRow & “‘;”
Debug.Print “SQL is ” & mySQL
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset(mySQL)[/codebox]
this generates the error “the SELECT statement includes a reserved word or an argument name that is misspelled or missing, or the punctuation is incorrect.”
Fine. Debug.Print outputs
Select count(*) from [EditMDS] Where [Form Dln] = ‘83197501130’;
which, if i run as a SQL Query, executes just fine.
???