Access 2002 .adp subform linking using stored procedures

D

Doug

I have an access subform that used to have a recordsource of a SQL Server
View. I am running into sorting issues with SQL Server 2005 and need to
change the view to stored procedure. The stored procedure returns a sorted
recordset without requiring any parameters. I change the recordsource on the
subform to be the name of the stored procedure and kept all of the linking
fields the same. The problem is that the subform now includes all the
records in the database instead of only the records based on the master/sub
link fields.

Is there a way around this?
 
S

Sylvain Lafontaine

Linked fields work only with tables and views and not with stored procedures
(SP); so you will have to use a parameterized SP or switch back to a view
and sort/filter the view by writing a standard sql string for the record
source in the OnCurrent event of the main form; something like:

..RecordSource = "Select * from MyView " & " Order By MyField1" ....

Also, the official newsgroup for ADP is m.p.access.adp.sqlserver.
 

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