Hello everyone,
I have some queries built which get some of their paramaters from a form. The queries work fine and pull the appropriate data. I am now trying to build a spreadsheet based on one of the queries.
I first open a recordset and then I use the CopyFromRecordset routine:
However I get an error on my the rs.Open line that reads "No value given for one or more required paramaters". I assume this is because the query, qryNextToGo_filtered, uses a value from a form. But my form is open when I run this code so should it not still work? If I open the query, qryNextToGo_filtered, manually it opens fine. Also if I use this code to open another similar query which does not require a value from a form it opens fine.
Any thoughts or suggestions?
Thanks,
Collen
I have some queries built which get some of their paramaters from a form. The queries work fine and pull the appropriate data. I am now trying to build a spreadsheet based on one of the queries.
I first open a recordset and then I use the CopyFromRecordset routine:
Code:
rs.Open "select StepMember, TicketNo, PoleOwner, Priority, County, Place, Location, JobType " & _
"from qryNextToGo_filtered", CurrentProject.Connection, adOpenKeyset, adLockOptimistic
objSht.Cells(1, 1).CopyFromRecordset rs
However I get an error on my the rs.Open line that reads "No value given for one or more required paramaters". I assume this is because the query, qryNextToGo_filtered, uses a value from a form. But my form is open when I run this code so should it not still work? If I open the query, qryNextToGo_filtered, manually it opens fine. Also if I use this code to open another similar query which does not require a value from a form it opens fine.
Any thoughts or suggestions?
Thanks,
Collen