Wrox Programmer Forums
|
Pro VB Databases Advanced-level VB coding questions specific to using VB with databases. Beginning-level questions or issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2008, 05:21 PM
Authorized User
 
Join Date: Nov 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.



 
Old January 29th, 2008, 01:46 PM
Authorized User
 
Join Date: Nov 2007
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nevermind, Solved problem on my own.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Recordset.recordcount = -1 Huss Classic ASP Databases 0 February 17th, 2007 04:41 AM
RecordCount dpkbahuguna Beginning VB 6 9 March 23rd, 2006 01:16 AM
RecordCount property doesn't work eapsokha Classic ASP Databases 6 February 10th, 2005 01:28 PM
RecordCount in DataGrid and Excel AyatKh ASP.NET 1.x and 2.0 Application Design 1 March 22nd, 2004 04:23 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.