Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ms access “访问”;运行时错误3464“;条件表达式中的数据类型不匹配_Ms Access_Vba - Fatal编程技术网

Ms access “访问”;运行时错误3464“;条件表达式中的数据类型不匹配

Ms access “访问”;运行时错误3464“;条件表达式中的数据类型不匹配,ms-access,vba,Ms Access,Vba,单击下拉菜单和我放在其中的条目部分后,我得到运行时错误3464,这是数据类型不匹配,并在Set rsrecall=dbsrecall.OpenRecordset(strSQLWork)处停止 我错过了什么 Dim dbsrecall As DAO.Database Dim rsrecall As DAO.Recordset Dim intRecCnt As Integer On Error GoTo Err_Click strSQLWork = "SELECT tblAB.ID, .,.(l

单击下拉菜单和我放在其中的条目部分后,我得到运行时错误3464,这是数据类型不匹配,并在Set rsrecall=dbsrecall.OpenRecordset(strSQLWork)处停止

我错过了什么

Dim dbsrecall As DAO.Database
Dim rsrecall As DAO.Recordset
Dim intRecCnt As Integer

On Error GoTo Err_Click

strSQLWork = "SELECT tblAB.ID, .,.(lots)...., FROM tblAB WHERE tblAB.Title = " & Me.cmbGetRecall & " ORDER BY tblAB.CreationDate, tblAB.SolutionTarget, tblAB.StartDate;"

Set dbsrecall = CurrentDb()
Set rsrecall = dbsrecall.OpenRecordset(strSQLWork)

rsrecall.MoveFirst

ReDim arrRecall(1, 70)

arrRecall(1, 1) = rsrecall!abc
arrRecall(1, 2) = rsrecall!def
.
.(contd.)
.
arrRecall(1,70) = rsrecall!xyz

Me.txtTitle.SetFocus
Me.lblRecall.Visible = False
Me.cmbGetRecall.Visible = False

Me.txtqwe = arrRecall(1, 4)
Me.txtrty = arrRecall(1, 5)
Me.txtuio = arrRecall(1, 6)
.
.(contd.)  
.
me.txtghj = arrRecall(1,70)

Exit Sub
Err_Click:
resp = MsgBox("No records were found for this selection." & Chr(10) & Chr(13) & Chr(10) & Chr(13) & "Please try again.", vbOKOnly)

Me.cmbSol = ""
Me.cmbSol.SetFocus
试一试


乍一看,我看不出有什么问题。模块顶部是否有“Option Explicit”选项?若并没有,那个么添加它,然后编译以查看是否有任何错误。我在项目的不同部分有相同的ARRRELECT逻辑,这是一个问题吗?好吧,现在一个似乎被替换为:运行时错误3021:rsrecall.MovefirstRESOLVED没有当前记录:…其中tblAB.Title=“&Me.cmbGetRecall&”ORDER by。。。。谢谢你们的帮助,伙计们
strSQLWork = " SELECT tblAB.ID, .,.(lots)...., FROM tblAB " & _
                      " WHERE tblAB.Title = '" & Me.cmbGetRecall & "'" & _
                      " ORDER BY tblAB.CreationDate, tblAB.SolutionTarget, tblAB.StartDate;"