I have a working query between 2 tables which utilizes two dates from 2 Active x calendar controls for the Start_date and End_date range which reside on a form. Seems easy enough and the query works. The query also works when I key in the actual date "1/25/2007" as a criteria instead of the Calendar criteria but not 1/25/2007.
However, when I add the query to my project, which worked before the caledars, I now get the error
Too Few Parameters, Expected 2
Here is the snippet of code which creates my recordset.
Here is the where clause from my query, it is pulling from Oracle so I need to only look at the date portion of the Date/Time field Oracle utilizes. Again, this works when I run the query from the query list but not from the VB.
Is it that when I run the saved query from VB it can't find the fields on the form or is it bringing back 1/25/2007 instead of "1/25/2007" with the double quotes?
I'm afraid that someone is going to say run it from SQL statement in the VB code, and I'll try if it is the only way.
Thanks for any ideas.
However, when I add the query to my project, which worked before the caledars, I now get the error
Too Few Parameters, Expected 2
Here is the snippet of code which creates my recordset.
Code:
'open recordset on the Shipments table
Set rst = New ADODB.Recordset
With rst
.Open "[qry_rpt_7_shipments_by_store_final]", strConn, adOpenForwardOnly, adLockReadOnly, adCmdStoredProc
End With
Here is the where clause from my query, it is pulling from Oracle so I need to only look at the date portion of the Date/Time field Oracle utilizes. Again, this works when I run the query from the query list but not from the VB.
Code:
WHERE (((DateValue([APPS_XXCOC_SHIPMENTS_MV]![SALES_DATE])) Between [Forms]![frm_date_selector]![start_date] And [Forms]![frm_date_selector]![end_date]))
Is it that when I run the saved query from VB it can't find the fields on the form or is it bringing back 1/25/2007 instead of "1/25/2007" with the double quotes?
I'm afraid that someone is going to say run it from SQL statement in the VB code, and I'll try if it is the only way.
Thanks for any ideas.