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
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
.CursorType = adOpenStatic
.Open "tblContacts", CurrentProject.Connection
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?