I have the following code:
[VBA]
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
[/VBA]
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.