Friends,
Hope you can shed some light on this problem. I'm trying to create a recordset from a QueryDef with one parameter.
I give the user a List box (List1) to select a value that becomes the parameter for a select query that's defined in a QueryDef. Here's the code I'm executing in a Form module...
And, here's the contents of the QueryDef...
Everytime I attempt the OpenRecordset command, I get an Error 13, 'Type Mistmatch'. I've check numerous times that Upstream.EBPID is text and that the parameter, set to TargetEBP, is a string.
Any ideas?
Jimbo
Hope you can shed some light on this problem. I'm trying to create a recordset from a QueryDef with one parameter.
I give the user a List box (List1) to select a value that becomes the parameter for a select query that's defined in a QueryDef. Here's the code I'm executing in a Form module...
Code:
'look for upstreams EBP in each selected EBP in the listbox
For Each idx In List1.ItemsSelected
TargetEBP = List1.ItemData(idx)
'open recordset to read upstream ebp's
qdf.Parameters("param1") = TargetEBP
Set rst = qdf.OpenRecordset(dbOpenForwardOnly)
...snip...
Next
And, here's the contents of the QueryDef...
Code:
?qdf.SQL
SELECT Upstream.EBPID, Upstream.UpstreamEBP, Upstream.ANDGATE, Upstream.XORGATE
FROM Upstream
WHERE (((Upstream.EBPID)=[param1]));
Everytime I attempt the OpenRecordset command, I get an Error 13, 'Type Mistmatch'. I've check numerous times that Upstream.EBPID is text and that the parameter, set to TargetEBP, is a string.
Any ideas?
Jimbo