Run-time error ‘-2147217904’

D

David

Hello,

The rst.Open command in the following code generates the error:

"Run-time error ‘-2147217904’

Too few parameters. Expected 11."

Dim cnn As New ADODB.Connection, rst As New ADODB.Recordset Dim strSQL As
String

strSQL = "Select * from qryUOFQueryUnique"
Set cnn = CurrentProject.Connection
rst.Open strSQL, cnn, adOpenKeyset, adLockOptimistic, adCmdTableDirect

Any ideas?
 
D

Douglas J. Steele

What's the SQL for qryUOFQueryUnique? Does it refer to controls on a form,
or have other parameters in it?
 
D

David

Yes it does. It refers to controls on a form which form the criteria of the
query.

What I am trying to do in the end, is to get the unique count of the records
in that query, so the query qryUOFQueryUnique selects a UNIQUE record set
based on the one field selected in that query, that being an ID field.

I was then going to do the command Me.strRecords = rst.RecordCount.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top