asherman86
05-28-2013, 12:14 PM
I have the following code:
If Me.cmbWorkgroups.Enabled Then
With cmd
.ActiveConnection = CurrentProject.Connection
.CommandText = "vRecsPerBox_withWorkgroup"
.CommandType = adCmdStoredProc
.Parameters.append .CreateParameter("wg", adVarChar, adParamInput, 100)
End With
cmd.Parameters("wg") = Me.cmbWorkgroups
Set rs = cmd.Execute
Debug.Print rs.RecordCount
Else
When I run the query and just type in the parameter value, it returns plenty of values. When I try to run it from vba, I get -1 no matter what I do.
Any advice would be helpful. :banghead:
If Me.cmbWorkgroups.Enabled Then
With cmd
.ActiveConnection = CurrentProject.Connection
.CommandText = "vRecsPerBox_withWorkgroup"
.CommandType = adCmdStoredProc
.Parameters.append .CreateParameter("wg", adVarChar, adParamInput, 100)
End With
cmd.Parameters("wg") = Me.cmbWorkgroups
Set rs = cmd.Execute
Debug.Print rs.RecordCount
Else
When I run the query and just type in the parameter value, it returns plenty of values. When I try to run it from vba, I get -1 no matter what I do.
Any advice would be helpful. :banghead: