C
Cynthia
I am trying to get a recordset (list) and I get the following error
Arguments are of the wrong type, are out of acceptable range or are in
conflict with one another.
Any Ideas? The error is on the Rs.open. I have used the same cn and rs
values
on other parts of the form with no problem. I am trying to pull a list
duplicate circuit numbers?
HERE IS THE CODE:
Private Sub CmdShowDup_Click()
On Error GoTo Err_CmdShowDup_Click
Dim cn As ADODB.Connection
Dim rs As New ADODB.Recordset
Set cn = Application.CurrentProject.Connection
Dim rdup As String
rdup = ""
Dim strQry As String
strQry = IsNull(DLookup("[Circuit]", "[CircuitDuplicate]"))
If strQry = "True" Then
MsgBox ("No Duplicates found")
Else
'--I tried the remarked out line below using a query called
circuitduplicate
'--that only has the duplicate numbers.
'--strQry = "Select CD.circuit from circuitduplicate As CD"
'-- here tried getting the data straight from the table either way
'--I get the error above
strQry = "SELECT Count(EleCircuitList.Circuit) AS CountOfCircuit,
EleCircuitList.Circuit" & _
" FROM EleCircuitList GROUP BY EleCircuitList.Circuit
Where (((Count(EleCircuitList.Circuit)) > 1))"
Debug.Print strQry
rs.Open stsrQry, cn, 1
Do While rs.EOF = False
rdup = rdup & rs!Circuit & ","
rs.MoveNext
Loop
Me.Filter = "([qryCircuit].[Circuit] = '" & rdup & "')"
Me.FilterOn = True
End If
Arguments are of the wrong type, are out of acceptable range or are in
conflict with one another.
Any Ideas? The error is on the Rs.open. I have used the same cn and rs
values
on other parts of the form with no problem. I am trying to pull a list
duplicate circuit numbers?
HERE IS THE CODE:
Private Sub CmdShowDup_Click()
On Error GoTo Err_CmdShowDup_Click
Dim cn As ADODB.Connection
Dim rs As New ADODB.Recordset
Set cn = Application.CurrentProject.Connection
Dim rdup As String
rdup = ""
Dim strQry As String
strQry = IsNull(DLookup("[Circuit]", "[CircuitDuplicate]"))
If strQry = "True" Then
MsgBox ("No Duplicates found")
Else
'--I tried the remarked out line below using a query called
circuitduplicate
'--that only has the duplicate numbers.
'--strQry = "Select CD.circuit from circuitduplicate As CD"
'-- here tried getting the data straight from the table either way
'--I get the error above
strQry = "SELECT Count(EleCircuitList.Circuit) AS CountOfCircuit,
EleCircuitList.Circuit" & _
" FROM EleCircuitList GROUP BY EleCircuitList.Circuit
Where (((Count(EleCircuitList.Circuit)) > 1))"
Debug.Print strQry
rs.Open stsrQry, cn, 1
Do While rs.EOF = False
rdup = rdup & rs!Circuit & ","
rs.MoveNext
Loop
Me.Filter = "([qryCircuit].[Circuit] = '" & rdup & "')"
Me.FilterOn = True
End If