ADP + stored procedure + sync subform

  • Thread starter Thread starter PBsoft
  • Start date Start date
P

PBsoft

In an ADP project (Access 2003), I'm trying to use master/detail form feature,
but I'm getting a problem.

Both the master form and the detail one have a stored procedure as record
source (obviously SPs are different).
Moving among records in the master form, the detail form is not updated consequently.

Everything works ok if I use directly the tables for both form record sources.

I suppose the problem mey be solved using Resync form property, but I can't
solve it.

May someone help me?
 
The Resync command has nothing to do with resynchronising a subform. Please
search this newsgroup with Google to get examples of using the resync
command.

The easiest way is to set the Link Child Fields and the Link Master Fields
to the name of the parameters (without the @) used in the SP of the subform.
Another way would be to use an EXEC command to call the SP as its record
source and change its value in the onCurrent event of the main form;
something like:

Me!Name_of_the_Subform.Form.RecordSource = _
"exec dbo.MyStoredProcedure " & Me.FirstParameter & ", " &
Me.SecondParameter

I usually use the Link Fields method for subforms and the second method for
controls with rowsource (comboboxes, etc.) on subforms.
 
The easiest way is to set the Link Child Fields and the Link Master
Fields to the name of the parameters (without the @) used in the SP of
the subform.

Thanks Sylvain, but I read the following

================
You can use the SELECT statement and the WHERE clause with tables and views,
but not with stored procedures. Therefore, values in the LinkChildFields
and LinkMasterFields properties are ignored if a stored procedure is the
record source of a subform.
================

in this article from Microsoft: http://support.microsoft.com/kb/236368/en-us

So I thought those parameters cannot be used anyway.
 
This was true for ADP 2000 but not for 2002+ as it's clearly stated in the
article.
 
I use linkChildFields and linkMasterFields in order to pass parameters into
sprocs all the time
 
Back
Top