procedures views and subforms

E

Educo Gent

I use microsoft access 2002 and sqlserver 2000.

Is it not possible to use a stored procedure as source of a subform in a
form (both are linked by a field)? Problem is: the records shown in the
subform are not only those who are linked with the record in the form, but
all records are shown.

If I use a view as source for the subform, the problems are solved.

Thanks for help.
 
J

J. Clay

Use parameters in the stored procedure to filter the records to the parent
form and then set the imput parameters in the sub form to reference the
parent form field that corresponds to the parameter.

In the subform input parameters you would do something like:

@InventoryID INT = Forms("NewProducts")("IMInventoryID")

Where the form you are referring to is te parent form.

HTH,
Jim
 
E

Educo Gent

thanks for help

J. Clay said:
Use parameters in the stored procedure to filter the records to the parent
form and then set the imput parameters in the sub form to reference the
parent form field that corresponds to the parameter.

In the subform input parameters you would do something like:

@InventoryID INT = Forms("NewProducts")("IMInventoryID")

Where the form you are referring to is te parent form.

HTH,
Jim
 
L

liu yumin

Educo Gent said:
I use microsoft access 2002 and sqlserver 2000.

Is it not possible to use a stored procedure as source of a subform in a
form (both are linked by a field)? Problem is: the records shown in the
subform are not only those who are linked with the record in the form, but
all records are shown.

If I use a view as source for the subform, the problems are solved.

Thanks for help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top