Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2009
    Posts
    67

    Unanswered: count on subfrom

    I have main form and subform. The subform will have 10 to 15 items how can I have row or record count on subform for display only.

    1.
    2.
    3.
    4.
    and so on
    Thanks
    Last edited by hmho; 07-07-09 at 19:52.

  2. #2
    Join Date
    Mar 2009
    Posts
    5,441
    Provided Answers: 14
    Here is a solution:

    Code:
    Function GetFormRecordCount(SomeForm As Form) As Long
        
        If SomeForm.FilterOn = True Then
            GetFormRecordCount = Nz(DCount("*", CStr(SomeForm.RecordSource), CStr(SomeForm.Filter)), 0)
        Else
            GetFormRecordCount = Nz(DCount("*", CStr(SomeForm.RecordSource)), 0)
        End If
        
    End Function
    Have a nice day!

Posting Permissions

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