prettyangel
Programmer
Can someone help me?
I need to create a report that will take parameters supplied through a combobox control. I need to create the parameter and assign combobox's value to it which I did but it's giving me error plus I've forgotten how to use the declared parameter to create the report.
Below is the code snippet.
Code:
Sub GetMonth()
Set spGetMonth = New ADODB.Command
spGetMonth.CommandText = "GetMonth"
spGetMonth.CommandType = adCmdStoredProc
strMonth = Trim(cboFromPayPeriod.Text)
Set prmbyMonth = spGetMonth.CreateParameter("@GetMonth", adVarChar, adParamInput)
spGetMonth.Parameters.Append prmbyMonth
prmbyMonth.Value = strMonth
' Create recordset by executing the command.
Set spGetMonth.ActiveConnection = dbconnect
Set rstGetMonth = spGetMonth.Execute
End Sub
I need to create a report that will take parameters supplied through a combobox control. I need to create the parameter and assign combobox's value to it which I did but it's giving me error plus I've forgotten how to use the declared parameter to create the report.
Below is the code snippet.
Code:
Sub GetMonth()
Set spGetMonth = New ADODB.Command
spGetMonth.CommandText = "GetMonth"
spGetMonth.CommandType = adCmdStoredProc
strMonth = Trim(cboFromPayPeriod.Text)
Set prmbyMonth = spGetMonth.CreateParameter("@GetMonth", adVarChar, adParamInput)
spGetMonth.Parameters.Append prmbyMonth
prmbyMonth.Value = strMonth
' Create recordset by executing the command.
Set spGetMonth.ActiveConnection = dbconnect
Set rstGetMonth = spGetMonth.Execute
End Sub