一旦單擊下拉菜單和我放在那裏的條目部分,就會得到運行時錯誤3464,它是數據類型不匹配並停在設置rsrecall = dbsrecall .OpenRecordset(strSQLWork)訪問「運行時錯誤3464」條件表達式中的數據類型不匹配
我在這裏丟失了什麼?
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'?如果沒有,添加,然後編譯,看看你是否有任何錯誤。 –
我確實有Option Explicit。我在項目的不同部分有相同的arrRecall邏輯,是否有問題? – user3276522