L
Lauren Quantrell
I have a report. On the report's OnOpen event I have a routine that
decides what the recordset is going to be:
Select Case Forms!myForm.MyMethod
Case 1
me.recordsource = "myRecordSource1"
Case 2
me.recordsource = "myRecordSource2"
etc...
End Select
This works fine ONLY IF:
I have the input parameters already in place in the report's design
view
AND
only if there is already a recordsource specified for the report in
design view.
Otherwise I get a parameter prompt.
Shouldn't I be able to construct it like this the following?:
Select Case Forms!myForm.MyMethod
Case 1
me.inputparameters = "@myID = Forms!myForm.myID, @myString =
Forms!myForm.MyField"
me.recordsource = "myRecordSource1"
Case 2
me.inputparameters = "@myProductID = Forms!myForm.myProductID,
@myWhatever = Forms!myForm.MyWhatever"
me.recordsource = "myRecordSource2"
etc...
End Select
It seems like this should work because I'm changing the input
parameters before changing the recordsource, but I get a parameter
prompt here.
Any help on how to do this is appreciated.
lq
decides what the recordset is going to be:
Select Case Forms!myForm.MyMethod
Case 1
me.recordsource = "myRecordSource1"
Case 2
me.recordsource = "myRecordSource2"
etc...
End Select
This works fine ONLY IF:
I have the input parameters already in place in the report's design
view
AND
only if there is already a recordsource specified for the report in
design view.
Otherwise I get a parameter prompt.
Shouldn't I be able to construct it like this the following?:
Select Case Forms!myForm.MyMethod
Case 1
me.inputparameters = "@myID = Forms!myForm.myID, @myString =
Forms!myForm.MyField"
me.recordsource = "myRecordSource1"
Case 2
me.inputparameters = "@myProductID = Forms!myForm.myProductID,
@myWhatever = Forms!myForm.MyWhatever"
me.recordsource = "myRecordSource2"
etc...
End Select
It seems like this should work because I'm changing the input
parameters before changing the recordsource, but I get a parameter
prompt here.
Any help on how to do this is appreciated.
lq