G
Guest
Hello:
I have a form which has the fields CustomerID and PlanID. This form is used
to select a customer and home plan and load the specifications for the
customers home in to a table there is a command button which has the
following code attached:
Private Sub cmdCreateHome_Click()
On Error GoTo Err_cmdCreateHome_Click
Dim stDocName As String
stDocName = "tsh_AddCustSpec"
DoCmd.OpenStoredProcedure stDocName, acViewNormal, acEdit
Exit_cmdCreateHome_Click:
Exit Sub
Err_cmdCreateHome_Click:
MsgBox Err.Description
Resume Exit_cmdCreateHome_Click
End Sub
Here is the code for the stored procedure which runs:
ALTER PROC tsh_AddCustSpec (
@CustID INTEGER,
@PlanID INTEGER
)
AS
INSERT INTO CustSpecs
(CustSpecs_CustID,
CustSpecs_PlanID,
CustSpecs_RoomID,
CustSpecs_Present)
SELECT @CustID, Plans_PlanID, Plans_RoomID, Plans_Present
FROM PlanSpecs
WHERE Plans_PlanID = @PlanID
In the Input Parameter of the form, I have placed the following:
@CustID int = Forms!frmCreateHome!cboCustomer, @PlanID int =
Forms!frmCreateHome!cboPlan
Upon opening the form, I get the following error:
Bad query parameter '@CustID"
What am I doing wrong?
Thanks
Brennan
I have a form which has the fields CustomerID and PlanID. This form is used
to select a customer and home plan and load the specifications for the
customers home in to a table there is a command button which has the
following code attached:
Private Sub cmdCreateHome_Click()
On Error GoTo Err_cmdCreateHome_Click
Dim stDocName As String
stDocName = "tsh_AddCustSpec"
DoCmd.OpenStoredProcedure stDocName, acViewNormal, acEdit
Exit_cmdCreateHome_Click:
Exit Sub
Err_cmdCreateHome_Click:
MsgBox Err.Description
Resume Exit_cmdCreateHome_Click
End Sub
Here is the code for the stored procedure which runs:
ALTER PROC tsh_AddCustSpec (
@CustID INTEGER,
@PlanID INTEGER
)
AS
INSERT INTO CustSpecs
(CustSpecs_CustID,
CustSpecs_PlanID,
CustSpecs_RoomID,
CustSpecs_Present)
SELECT @CustID, Plans_PlanID, Plans_RoomID, Plans_Present
FROM PlanSpecs
WHERE Plans_PlanID = @PlanID
In the Input Parameter of the form, I have placed the following:
@CustID int = Forms!frmCreateHome!cboCustomer, @PlanID int =
Forms!frmCreateHome!cboPlan
Upon opening the form, I get the following error:
Bad query parameter '@CustID"
What am I doing wrong?
Thanks
Brennan