Access 2002 .adp subform linking using stored procedures

  • Thread starter Thread starter Doug
  • Start date Start date
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?
 
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.
 
Back
Top