Data Access Page filtered table update

Data Access Page filtered table update

Post by SmVyb2V » Wed, 19 Jan 2005 22:23:04

I'm programming with Data Acess Page to update a tabular view which is using
a subselection of a table. Nothing very particular but I cannot get a
solution to it. Please help me.

First of all my approach (which is probably not the best, so if you have any
better suggestion please let me know) is based on a dropdownlist.

The data section is a tabular view, based on a stored procedure
sp_INP_Adjusment. So the dataset that is being retrieved is depending on the
parameter set. The stored procedure is defined as:

ALTER PROCEDURE sp_INP_Adjustment @pCompanyID varchar(10) AS

FROM INP_Actual_Adjustment
WHERE CompanyID = @pCompanyID

When a change occurs at the dropdownlist occurs, it
executes the following script:

<SCRIPT language=vbscript event=onchange for=DropdownList1>

MSODSC.RecordsetDefs("sp_INP_Adjustment").parametervalues.Add "@pCompanyID",

This doesn't work properly. It seems like a have to bind the data again to
the tabular section... Any suggestion?

If have also tried many other commands, like:

- EXEC sp_INP_Adjustment RTrim(DropdownList1.value)
- DoCmd.OpenStoredProcedure "sp_INP_Adjustment", "Datasheet", "Edit"
- msodsc.recordsetdefs(0).parametervalues.Add "@pCompanyID",
- MSODSC.GetContainingSection("HeaderspINPAdjustment").DataPage.Requery

None of them works properly. I have also put a statement MsgBox(), but not
always the message is shown. Does anybody know what I'm doing wrong?

Many thanks in advance,