我试图访问使用VBA code进行查询。我想我已经做了这样的100倍。我的code(上一个命令按钮),开始是这样的:
I'm trying to access a query using VBA code. I think I've done it this way 100 times. My code (on a command button) starts like this:
Dim rstDocCount As Recordset
Set rstDocCount = CurrentDb.QueryDefs("DocCount").OpenRecordset
rst.MoveFirst
我收到此错误信息:
I get this error message:
运行时错误'3061':参数太少。预期1。
Run-time error '3061': Too few parameters. Expected 1.
在设置rstDocCount
行以黄色高亮显示。
我是什么做错了吗?唯一的参数应该是查询的名称和予清楚有
What am I doing wrong? The only parameter should be the name of the query and I clearly have that.
您需要:
Dim rstDocCount As Recordset
Dim qdf As QueryDef
Set qdf = CurrentDb.QueryDefs("DocCount")
qdf.Parameters("Forms!Boxing!BoxID") = Forms!Boxing!BoxID
Set rstDocCount = qdf.OpenRecordset
rstDocCount.MoveFirst
上一篇:Flash客户端的XMLSocket没有连接到服务器连接到、客户端、服务器、Flash
下一篇:如何引用一个嵌入的PowerPoint或Excel文件在Access中的窗体?窗体、文件、PowerPoint、Excel