Help RecordCount
I'm trying to get a count of an array that is filtered. (Search Record qry)
TO count the records I used this code:
If TogFilter.Value = -1 Then
If cboUnit.Value <> "" Then strFilt(0) = "[Unit] = '" & cboUnit.Value & "'"
If cboProjNo.Value <> "" Then strFilt(1) = "[ProjNo] = '" & cboProjNo.Value & "'"
If cboDwgNo.Value <> "" Then strFilt(2) = "[DwgNo] = '" & cboDwgNo.Value & "'"
If cboShtNo.Value <> "" Then strFilt(3) = "[ShtNo] = '" & cboShtNo.Value & "'"
If cboDwgType.Value <> "" Then strFilt(4) = "[DwgType] = '" & cboDwgType.Value & "'"
If cboPercDrwn.Value <> "" Then strFilt(5) = "[PercDrwn] = '" & cboPercDrwn.Value & "'"
If cboPercChkd.Value <> "" Then strFilt(6) = "[PercChkd] = '" & cboPercChkd.Value & "'"
If cboPIDNo.Value <> "" Then strFilt(7) = "[PIDNo] = '" & cboPIDNo.Value & "'"
If cboArea.Value <> "" Then strFilt(8) = "[Area] = '" & cboArea.Value & "'"
If cboRev.Value <> "" Then strFilt(9) = "[Rev] = '" & cboRev.Value & "'"
If cboSize.Value <> "" Then strFilt(10) = "[Size] = '" & cboSize.Value & "'"
If cboService.Value <> "" Then strFilt(11) = "[Service] = '" & cboService.Value & "'"
If cboLineNo.Value <> "" Then strFilt(12) = "[LineNo] = '" & cboLineNo.Value & "'"
If cboSpec.Value <> "" Then strFilt(13) = "[Spec] = '" & cboSpec.Value & "'"
If cboFab.Value <> "" Then strFilt(14) = "[Fab] = '" & cboFab.Value & "'"
If IFADateStr <> "" Then strFilt(15) = IFADateStr
If IFCDateStr <> "" Then strFilt(16) = IFCDateStr
For aryIdx = LBound(strFilt) To UBound(strFilt)
If strFilt(aryIdx) <> "" Then
If FiltStr <> "" Then
FiltStr = FiltStr & " and " & strFilt(aryIdx)
Else
FiltStr = strFilt(aryIdx)
End If
End If
Next aryIdx
End If
If FiltStr = "" Then
FiltStr = "[LineNo] <> ''"
Else
FiltStr = "(" & FiltStr & ")"
End If
Me.Filter = FiltStr
Me.FilterOn = True
'--------------------------RecordCount Code
recCnt = Me.Recordset.RecordCount
Me!txtCount = recCnt
CntNo = txtCount.Value
MsgBox Me.Recordset.RecordCount
But here is my problem, I'm only getting a return number of "7"
Even though the search is showing 200.
What is going on????????
:(
Thanks for any help.
|