title: Stored Procedure using Parameters
body: <p>The Following code returns a stored procedure with a hard value coded. I need to allow 74 to change to whatever is selected from a combo box. Any help is greatly appreciated. I am using a pass through query in Access.</p>
  
  <pre><code>Private Sub ok_Click()
      Dim objConnection As New ADODB.Connection    
      Dim objCom As ADODB.Command
      Dim provStr As String
  
      Set objCom = New ADODB.Command
  
      objConnection.Provider = "sqloledb"
  
      provStr = "Data Source=**;" &amp; "Initial Catalog=IKB_QA;User Id=**;Password=**;"
  
      objConnection.Open provStr
  
      With objCom
          .ActiveConnection = objConnection
          .CommandText = "dbo.ix_spc_planogram_match 74"
          .CommandType = adCmdStoredProc
  
          .Execute
      End With
  
  End Sub
  </code></pre>