J
Jeroen
What I'm trying to achieve is having a tabular sheet for editing purposes
where a subset of the dataset is selected by a dropdownlist.
The data section is based on a tabular view, 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
SELECT *
FROM INP_Actual_Adjustment
WHERE CompanyID = @pCompanyID
A separate dropdownlist ("DropdownList1") has been defined which is
connected to a view with companies to select. When a change occurs, it
executes the following script:
<SCRIPT language=vbscript event=onchange for=DropdownList1>
MSODSC.RecordsetDefs("sp_INP_Adjustment").parametervalues.Add "@pCompanyID",
RTrim(DropdownList1.value)
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",
RTrim(DropdownList1.value)
- 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? I have
spend quite a lot of time already and I can't figure it out myself. Maybe the
approach is totally wrong? Please let me know.
Regards,
Jeroen
where a subset of the dataset is selected by a dropdownlist.
The data section is based on a tabular view, 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
SELECT *
FROM INP_Actual_Adjustment
WHERE CompanyID = @pCompanyID
A separate dropdownlist ("DropdownList1") has been defined which is
connected to a view with companies to select. When a change occurs, it
executes the following script:
<SCRIPT language=vbscript event=onchange for=DropdownList1>
MSODSC.RecordsetDefs("sp_INP_Adjustment").parametervalues.Add "@pCompanyID",
RTrim(DropdownList1.value)
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",
RTrim(DropdownList1.value)
- 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? I have
spend quite a lot of time already and I can't figure it out myself. Maybe the
approach is totally wrong? Please let me know.
Regards,
Jeroen