Pass Parameter to Stored Procedure
The Following code returns a stored procedure with a hard value coded. I need to allow 74(#catcode in Stored Procedure) to change to whatever is selected from a combo box. Any help is greatly appreciated. I am using a pass through query in Access. Private Sub ok_Click() Dim objConnection As New ADODB.Connection Dim objCom As ADODB.Command Dim provStr As String 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=***;" & "Initial Catalog=***;User Id=***;Password=***;" objConnection.Open provStr With objCom .ActiveConnection = objConnection .CommandText = "dbo.ix_spc_planogram_match " & ("#catcode=") & Me.cat_code.Value .CommandType = adCmdStoredProc .Parameters.Refresh .Parameters("#catcode").Value = me.cat_code.value .Execute End With End Sub Stored Procedure: execute dbo.ix_spc_planogram_match #catcode
I imagine that you mean something on these lines: .CommandText = "dbo.ix_spc_planogram_match " & me.cat_code .CommandType = adCmdStoredProc .cmd.Parameters("#catcode") = me.cat_code .Execute This is assuming that the bound column of the combo contains the required value.
Id field (primary key) is skipping numbers of rows that have been deleted, how to change?
Create a Schedule task that run a access file
Does Access 2013 still have an ACE database or equivalent?
Creating 2D (Data Matrix or QR Codes) in MS Access Reports/Forms
Mass Delete Individual Fields
Error on INSERT statement
Microsoft Access 2003 - Expression Builder
Reference existing expression
Automatically updated the textbox
Profiler for MSAccess
Access Switchboard Manager: Invalid Procedure Call or Argument
how should this SQL be written?
Data type for currency values in Access
Update top rows in Access table that match condition
Data type in access 2007
How to specify a custom format for a text pattern in Microsoft Access?