Form Record Source = sproc, how pass parameter

Form Record Source = sproc, how pass parameter

Post by Steve » Thu, 22 Jan 2004 19:56:11



Hi,

I had a form which had its record source set using the on
open event in an Access Form to 'select * from MyView
where Fielda = combo box on other form'.
Fine, no problems, can edit data etc.

But then I assigned a sub select:
'select * from MyView where fielda = combo AND fieldb in
(select * from tableb where fieldb = combo2).
This stopped the form from being updatable, even with the
Unique Table property set.

So I'm now using a sproc as the record source for the
form, and it expects a couple of parameters.  I can
usually pass parameters to sprocs ok, but now Im stuck.

When the form opens a couple of Input Box's appear asking
for the parameter values, not the desired effect.

Could someone let me know / point me to somewhere where I
can see how to pass a parameter to a sproc which is the
record source of an updateable form please?

Basically so a user makes a selection using combo box's in
FormA, clicks a button to load FormB which has a sproc as
its record source and has had the parameters passed from
the combos so the FormB loads correctly (without
InputBox's popping up).

Cheers!

Steve'o

 
 
 

Form Record Source = sproc, how pass parameter

Post by Steve » Thu, 22 Jan 2004 20:24:24


It must be late in the day, eyesight not what it was.

Apologies guy's, I've spent ages looking at this but
missed the painfully obvious Form property "Input
Parameters"

So I've used the on-open event of the form to change the
Input parameter property, which passes the paramter
results to the sproc, and the form is now updateable with
a sub select in its record source!

(its odd that a having a sproc (with a sub select) as the
record source is updateable, but putting the same SQL into
the record source makes the form non-updateable).

Anyway, apologies for time wasting.

Thanks again.

Quote:>-----Original Message-----
>Hi,

>I had a form which had its record source set using the on
>open event in an Access Form to 'select * from MyView
>where Fielda = combo box on other form'.
>Fine, no problems, can edit data etc.

>But then I assigned a sub select:
>'select * from MyView where fielda = combo AND fieldb in
>(select * from tableb where fieldb = combo2).
>This stopped the form from being updatable, even with the
>Unique Table property set.

>So I'm now using a sproc as the record source for the
>form, and it expects a couple of parameters.  I can
>usually pass parameters to sprocs ok, but now Im stuck.

>When the form opens a couple of Input Box's appear asking
>for the parameter values, not the desired effect.

>Could someone let me know / point me to somewhere where I
>can see how to pass a parameter to a sproc which is the
>record source of an updateable form please?

>Basically so a user makes a selection using combo box's
in
>FormA, clicks a button to load FormB which has a sproc as
>its record source and has had the parameters passed from
>the combos so the FormB loads correctly (without
>InputBox's popping up).

>Cheers!

>Steve'o
>.


 
 
 

1. Sproc and Input Parameters as Record Source for Report

I have lots of reports that run with the recordsource as a sproc and the
input parameters looking to a text box on an open form. I am using the same
syntax successfully on over 40 reports.  Suddenly, I have one report that
will not cooperate. When I type in values into the InputParameters property
on the report, all's well; but when the values appear on the form, I get
"Provider command for child rowset does not produce a rowset.".

On my report, input parameters read:


Forms!frmWiz!subcrit!txtParam_Event

While the above fails, hard coding the values for the paramenteres, works
just fine, such as:

I've tried a combination of hard coding and looking at the form.  As long as
any single parameter is looking to the form, I get the error.

What could I be doing wrong? What could be different about this report
compared to all the others that I have running (over 40!) using this same
method.  There are definitely no typos.  I've checked that a million times.
I've also checked every possible combination of using ticks around the
values in the textboxes on the form versus not.  That's not it either.

I'm in A2K ADP file connected to SQL Server 2000.

--Susan

2. Client access

3. How to put a Form parameter in Adodc Control Record Source property

4. InstallShield and Interbase

5. Is it possible to pass in a parameter for a table name in a SProc

6. CoInitialise has not been called

7. Passing multiple parameters to a sproc with FullText (WHERE CONTAINS)

8. urgent, saving image from base64

9. Passing a parameter to a view within a SPROC

10. howto pass parameters to sproc?

11. Passing Parameters From a Sproc To A Trigger

12. Pass-Through Queries from Access - How to pass form-based parameters