9/1/2005
I am having difficulty opening a query recordset for analysis.
The following code opens the query with no problems when the query has
either no criteria or criteria specified as constants. When I attempt to put
a variable in the query criteria, it stops at the line
.Open qryName, Options:=adCmdTableDirect
with the Run Time Error that says "Too few parameters. Expected x" where x
is the number of variables specified in the criteria
Can you tell me what is wrong and how to fix it?
I will post this to a couple of newsgroups because I'm not sure which one is
appropriate.
If possible, please respond to me directly at abbaker2@comcast.net. as I am
a newbie to these newsgroups.
Many many thanks.
Al Baker
Sub QueryTableLookup()
Const qryName As String = "qryVerifyDeleteRecords"
Dim rstqryEquipOne As ADODB.Recordset
Set rstqryEquipOne = New ADODB.Recordset
Set rstqryEquipOne.ActiveConnection = CurrentProject.Connection
With rstqryEquipOne
.CursorType = adOpenKeyset
.Open qryName, Options:=adCmdTableDirect
End With
DoCmd.OpenQuery qryName, acNormal, acEdit
rstqryEquipOne.MoveFirst
LastEquipId = rstqryEquipOne!ID
Stop
End
Ken Snell [MVP] - 01 Sep 2005 15:53 GMT
see reply in other newsgroup where you've posted this... please do not
multipost the exact same question in multiple newsgroups.. one post usually
is sufficient.

Signature
Ken Snell
<MS ACCESS MVP>
> 9/1/2005
>
[quoted text clipped - 51 lines]
>
> End