rrhandle8
asked on
VBA Run-Time error '3265' parameter query
I get the error on this line: qdf.Parameters("[episode]" ).Value = 10
Error: Item not found in this collection.
Error: Item not found in this collection.
Sub test()
Dim dbs As DAO.Database
Dim qdf As DAO.QueryDef
Dim prm As DAO.Parameter
Dim rst As DAO.Recordset
Set qdf = CurrentDb.QueryDefs("ValueMemo Query2")
qdf.Parameters("[episode]").Value = 10
Set rst = qdf.OpenRecordset
Do While Not rst.EOF
Debug.Print rst("ValueMemo")
Loop
End Sub
ASKER
SELECT *
FROM FieldValue AS f, [session] AS s
WHERE f.objectid = s.sessionid and s.isnote=0 and s.providerid = 2 and s.episodeid = ["episode"]
ORDER BY s.StartDateTime DESC;
FROM FieldValue AS f, [session] AS s
WHERE f.objectid = s.sessionid and s.isnote=0 and s.providerid = 2 and s.episodeid = ["episode"]
ORDER BY s.StartDateTime DESC;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
revise your query like this
PARAMETERS episode Long;
SELECT *
FROM FieldValue AS f, [session] AS s
WHERE f.objectid = s.sessionid and s.isnote=0 and s.providerid = 2 and s.episodeid = [episode]
ORDER BY s.StartDateTime DESC;
PARAMETERS episode Long;
SELECT *
FROM FieldValue AS f, [session] AS s
WHERE f.objectid = s.sessionid and s.isnote=0 and s.providerid = 2 and s.episodeid = [episode]
ORDER BY s.StartDateTime DESC;
Ron