varibles

  • What is the question?

  • I would like to pass a value from an Access adp project form to a parameter in a stored procedure is this possible and if so how?? The old =Forms!myform!mytextbox doesn’t  work

  • in the form source use dbo.ProcedureName

    and in input parameters : Forms!myform!mytextbox

    then separate each parameter with a comma.

  • Here is my code for the stored procedure

    Start code:

    Alter

    Procedure "sp_GetVar"

    (

    @FormVar nvarchar

    (20) 

    )

    As

    SELECT

    JobName, Version, [Version count], Comments,

    [envelope size], [complete date], [mail class], AssignmentFirst,

    [sort order], AssignmentSecond, ShipOrder

    FROM

    dbo.AutoVersionSource

    where

    JobName = @FormVar

    End code:

    It runs fine and returns the correct results, if I add the "@FormVar nvarchar(20)=Forms!myform!myvalue" it kicks at the"!"s

  • You can't include Forms!myform!myvalue in the proc code.

    You must create a new form

    set the data source of the form to dbo.ProcedureName

    then in input parameters you must set it to Forms!myform!myvalue

  • Okay I got it, thanks! Here are the steps for others to follow:

    1. Create a form based on the Stored Procedure (frmMyForm2)
    2. In the Stored Procedure place your input parameters.
    3. Create a form with no bound dataset (frmMyFrom1) I used a list box to control my results for the Stored Procedure and added a command button to open the results form  (frmMyForm2)
    4. In  (frmMyForm2) form properties reference the control from (frmMyForm1) Input Parameters =forms!frmMyForm1!lsbMyListb1

     

    User selects what they want from the list box, clicks the button and the desired results are viewed in the second form.

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply