i couldn't get anything to work using Screen.ActiveForm. but assuming that
every form that calls the function contains a label object named lblCount,
the following should work in a public module, as
Public Function RecCount()
On Error Resume Next
Dim intCount As Integer
With CodeContextObject
.RecordsetClone.MoveLast
intCount = .RecordsetClone.RecordCount
If intCount = 1 Then
!lblCount.Caption = "1 Item"
Else
!lblCount.Caption = intCount & " Items"
End If
End With
End Function
hth
> Same results
>
[quoted text clipped - 44 lines]
> >>> Thanks and Happy Thanksgiving!
> >>> James
JamesJ - 24 Nov 2005 13:31 GMT
I altered the code and I'm not sure why this works but..
I needed to check for no records so when the continuous form
displays only the new record the lblCount caption displays
0 Item(s). I was banging my head trying to check for no
records and I apparently don't need to.
All is fine now. Thanks
On Error Resume Next
Dim intCount As Integer
With CodeContextObject
intCount = .RecordsetClone.RecordCount
!lblCount.Caption = intCount & " Items"
End With
Thanks again,
James
>i couldn't get anything to work using Screen.ActiveForm. but assuming that
> every form that calls the function contains a label object named lblCount,
[quoted text clipped - 68 lines]
>> >>> Thanks and Happy Thanksgiving!
>> >>> James
tina - 24 Nov 2005 23:58 GMT
you're welcome :)
> I altered the code and I'm not sure why this works but..
> I needed to check for no records so when the continuous form
[quoted text clipped - 87 lines]
> >> >>> Thanks and Happy Thanksgiving!
> >> >>> James