I am trying to run TestFind() method example, but getting this error:
"Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', SELECT', or 'UPDATE'."
The error occurs on: .Open "tblContacts", CurrentProject.Connection
Code:
Private Sub cmdFind_Click()
Dim rsFind As ADODB.Recordset
'create a new instance of a recordset
Set rsFind = New ADODB.Recordset
'Set various properties of the recordset
With rsFind
.CursorType = adOpenStatic
.Open "tblContacts", CurrentProject.Connection
End With
...
End Sub
In the book is written explicitly "Notice how the preceding example does not use a separate connection object, but uses the existing connection for the project to create the recordset. This is an acceptable way if you will always be working with the same database of your current project."
Well, I am working within the same database, any ideas please?