Access 2007 RecordCount in subform based on query shows eg. "1 of 1" when it should be "1 of 3" until scroll records.

amy3000

New Member
Joined
Sep 23, 2009
Messages
13
I used the code found on this website to show a larger record count on a form and subform: Access Forms Masterclass #2: Custom Record Counter. The main form show the count correctly. Their are about 400 adults in the main form. The subform includes their children. So a mom with 3 kids the count should say "1 of 3" but it says "1 of 1". If I scroll through the 3 records it show the count correctly.

Here's the code I'm using. Thanks for you help.

Code:
Private Sub Form_Current()
If Me.NewRecord Then
        Me.lblRecordCounterChild.Caption = "New Record"
    Else
        Me.lblRecordCounterChild.Caption = _
         "Record " & Me.CurrentRecord & " of " & Me.Recordset.RecordCount
    End If
End Sub
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
IMHO record counts should not normally be relied upon -- the problem is that Access is optimized to display records before all the data is loaded. It may not bother getting a full count before it shows records.
 
Upvote 0

Forum statistics

Threads
1,216,188
Messages
6,129,397
Members
449,508
Latest member
futureskillsacademy

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top