Form Inputparameters

  • Hello all:

    Does anyone know the syntax for inputparameters in VB?  I've been trying to set it on a form as follows:

    Private Sub Form_Load()

        Me.InputParameters = "@TestPlan = " & [Forms]![frmMainMenu]![cboTestPlan] & ", @product = " & [Forms]![frmMainMenu]![lstProduct]

    End Sub

     

    I can't find a good example of the syntax.  Any help is greatly appreciated.

    Cleech

  • Start out with these declarations

    Dim ado_cmdx As ADODB.Command

    Dim cmdx_Param As ADODB.Parameter

    Dim Rs as ADODB.Recordset

    Set cmdx_Param = ado_cmdx.CreateParameter("@Name", adVarChar, adParamInput, 30, sTable) 'this sets up an input parameter, variable characterdata type with a maximum length of 30 character, and sTable is a string variable containing the VALUE of the parameter

     ado_cmdx.Parameters.Append cmdx_Param 'add the parameter to the commands parameter collection

    if you just want to execute the stored procedure then all that is required is

    ado_cmdx.execute

    If the procedure is to return data then

    Rs.Open,ado_cmdx   

     

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]

  • Try using the "OpenArgs" method of the OpenForm action...

    Syntax

    DoCmd.OpenForm formname[, view][, filtername][, wherecondition][, datamode][, windowmode][, openargs]

    For Example:

    DoCmd.OpenForm "yourOpenForm", , , , , , InfoYouWantToPassToNextForm

    Then when the next form opens, use what was passed...

    Private Sub Form_Load()

        yourFormField.Value = Forms("yourNextForm").OpenArgs

Viewing 3 posts - 1 through 2 (of 2 total)

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