Results 1 to 6 of 6

Thread: How many records? [Resolved]

  1. #1

    Thread Starter
    Addicted Member Bazzlad's Avatar
    Join Date
    Jun 2003
    Posts
    227

    How many records? [Resolved]

    I need a bit of code...
    I could do with a record count. To show how many records are being displayed...
    the figure being outputted to a textbox....
    this figure will change depending on what filters I put on the page....
    so if I only show records which have a boolean value of -1 for a check box I need the count to realise it's counting them...
    I know it does it automatically at the bottom of the form, but I want to put it in a text box, any ideas?
    Last edited by Bazzlad; Aug 13th, 2003 at 04:37 AM.
    *And you'll see, Everything you stand for is fake*
    http://www.rhesusrock.com

  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    You can set TextBox text to the value of Me.RecordCount or in Access you can use "=Count(*)".

  3. #3

    Thread Starter
    Addicted Member Bazzlad's Avatar
    Join Date
    Jun 2003
    Posts
    227
    Cheers mate!
    *And you'll see, Everything you stand for is fake*
    http://www.rhesusrock.com

  4. #4

    Thread Starter
    Addicted Member Bazzlad's Avatar
    Join Date
    Jun 2003
    Posts
    227
    Argghh, nearly people...
    recordset.recordcount Shows which record I'm on.... record 1, record 2 etc, I need the TOTAL of records.....?
    Or the LAST record...
    *And you'll see, Everything you stand for is fake*
    http://www.rhesusrock.com

  5. #5

    Thread Starter
    Addicted Member Bazzlad's Avatar
    Join Date
    Jun 2003
    Posts
    227
    Done it at bloody last, sloppy code always comes through

    VB Code:
    1. Dim stDocName As String
    2.     Dim stLinkCriteria As String
    3.  
    4.     stDocName = "frmstockview"
    5.  
    6.     stLinkCriteria = "[Item]=" & "'" & Me![Combo7] & "'"
    7.     stLinkCriteria = "[used?] = 0"
    8.      
    9.     DoCmd.OpenForm stDocName, , , stLinkCriteria
    10.    
    11.     DoCmd.GoToRecord , , acLast
    12.     [Forms]![frmstockview]![Text9].Value = [Forms]![frmstockview].Recordset.RecordCount
    13.     DoCmd.GoToRecord , , acFirst

    Thanx for your help and time.
    *And you'll see, Everything you stand for is fake*
    http://www.rhesusrock.com

  6. #6
    Lively Member
    Join Date
    Jun 2003
    Posts
    114
    The other thing for you to look at is seting the CursorLocation to adUseClient. This will give you a record count ... USING the RecordCount method of the cursor even ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width