Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Access
3rdpartyusrgrp
access
activexcontrol
adp.sqlserver
commandbarsui
conversion
dataaccess.pages
developers.toolkitode
devtoolkits
externaldata
forms
formscoding
gettingstarted
internet
interopoledde
macros
modulescoding
modulesdaovba
modulesdaovba.ado
multiuser
odbcclientsvr
queries
replication
reports
security
setupconfig
tablesdbdesign
  
 
date: Thu, 21 Aug 2008 06:46:01 -0700,    group: microsoft.public.access.formscoding        back       


Access 2002 .adp subform linking using stored procedures   
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?
date: Thu, 21 Aug 2008 06:46:01 -0700   author:   Doug

Re: Access 2002 .adp subform linking using stored procedures   
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.

-- 
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)


"Doug"  wrote in message 
news:815B42A5-5233-47D3-92B2-DFF4D97A4CF8@microsoft.com...
>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?
date: Thu, 21 Aug 2008 12:17:55 -0400   author:   Sylvain Lafontaine sylvain aei ca (fill the blanks, no spam please)

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us