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.
How to include MS Access 2007 Runtime as a prerequisite to msi
MS Access user defined function in select sql
How do I use a variable in an input mask in Access?
Access application crashing on ME.[ControlOrFormName] on some machines
MS Access How can I show the query name in a report
Autofill parts description via parts number text box
Microsoft Access 03 right click diabled or (ShortCut menu = no)
How to open a second form based on info from first form?
Help with a form not showing data when moving from Access 2003 to Access 2010
Access 2010 - Need to replace a null with a value
Very slow subqueries when using “NOT IN”
Microsoft Access - Scrambling Totals
Selecting data from the start of every hour
MS Access Query - Use a parameter value as one of the selected records
How can I add a filter to my form based upon a joined table's columns that don't appear in the Select clause?
MS Access - Open database form from URL