I believe that all parameters passed to forms and reports in MS Projects that talk to SQL Server must be in the format:
paramater name (eg: @id)
parameter type (eg: int)
paramater value
so Me.InputParameters="@id int=45"
However, I am coming up with a problem on dates.
I have a form (whose data is based on a parameterised stored procedure) with a drop down list of dates (cmbMondays); I change the data shown in the form thus:
Me.InputParameters = "@wsdate smalldatetime=#" & Format(cmbMondays, "dd mmm yyyy") & "#"
The form changes data correctly.
However, I also have a report based on a parameterised stored procedures that should work the same way. I pass the form's InputParameters to the report in the OpenArgs section:
DoCmd.OpenReport stDocName, acPreview, , , , Me.InputParameters
In the report_open event, I have:
Me.InputParameters = Nz(Me.OpenArgs, "@wsdate datetime=#1 Jan 2004#")
The report does NOT change its data!!
I have tried all sort of varants of date format and it still does not procude the data!!
Any thoughts much appreciated!
CR
|