I am not sure the best way to achieve my goal, so I am open to suggestions. I am converting a *.MDB into a project. I have a form that has three combo boxes that the user uses to make criteria selections. I know how to save the query as a Stored Procedure and to use the report to pass the Stored Procedure a parameter.
My problem is that I want to pass optional parameters. In Access I would use create a field like
IIf(IsNull([Forms]![frm_qbe]![cmb_IREF1]),True,[ITEMS]![ITEM_REF1]=[Forms]![frm_qbe]![cmb_IREF1]) AS MyField
with the criteria set to TRUE.
If the user left one of the combo boxes blank, it was not used in the criteria selection. I can't figure out how to pass a parameter to a Stored Procedure, and if it is NULL, not to include that in the WHERE clause.
My first idea is to use VBA to alter the Stored Procedure and then call it. Is that a good idea? How do I do that?
Thanks,
sabloomer
a
My problem is that I want to pass optional parameters. In Access I would use create a field like
IIf(IsNull([Forms]![frm_qbe]![cmb_IREF1]),True,[ITEMS]![ITEM_REF1]=[Forms]![frm_qbe]![cmb_IREF1]) AS MyField
with the criteria set to TRUE.
If the user left one of the combo boxes blank, it was not used in the criteria selection. I can't figure out how to pass a parameter to a Stored Procedure, and if it is NULL, not to include that in the WHERE clause.
My first idea is to use VBA to alter the Stored Procedure and then call it. Is that a good idea? How do I do that?
Thanks,
sabloomer
a