For many years, coding with RecordCount method worked without hitch across many related macros.
This year, all instances stopped working with error message:
"Compile Error
Type Mismatch"
highlighting on ".RecordCount" in the line "For tmpvar = 1 To rsttmp.RecordCount"
Something has obviously changed with Access -I am stumped and really would appreciate a solution!
An example of the multiple similarly misbehaving codes follows:
code
Dim rsttmp As ADODB.Recordset, tmpvar As Integer
tmpvar = 1
Set rsttmp = New ADODB.Recordset
With rsttmp
.CursorLocation = adUseClient
.ActiveConnection = CurrentProject.Connection
.Open "SR_NoDup", , adOpenKeyset, adLockPessimistic, adCmdTable
If Not rsttmp.RecordCount = 0 Then
For tmpvar = 1 To rsttmp.RecordCount
.Delete adAffectCurrent
.Update
.MoveNext
Next tmpvar
End If
End With
/code