J
Jasonm
Hi all (again!)
I am using the following code to show current position in a set of records
on a custom record counter:
Private Sub Form_Current()
Dim rs As Recordset, intCount As Integer
Dim strPosition As String ' Define Variables
Set rs = Me.RecordsetClone ' clone recordset to count records
strPosition = "Record No. " & Me.CurrentRecord & _
" of " & rs.RecordCount ' build a string with the position and count
txtPosition.Value = strPosition
End Sub
There may be an easier way to do this, but this was the only way that I
could figure out... The code works great when scrolling from record to
record, however it shows record 1 of 1 when the form loads and record 2 of
400 when I scroll to record #2. If I insert a break point at the point where
I set the value of strPosition the form loads with the correct value!
Does anyone have any ideas?
Thanks to all who have helped me in the past! I learn more by scrolling
through these groups in a couple o fhours than through weeks of classroom
training!
Jm
I am using the following code to show current position in a set of records
on a custom record counter:
Private Sub Form_Current()
Dim rs As Recordset, intCount As Integer
Dim strPosition As String ' Define Variables
Set rs = Me.RecordsetClone ' clone recordset to count records
strPosition = "Record No. " & Me.CurrentRecord & _
" of " & rs.RecordCount ' build a string with the position and count
txtPosition.Value = strPosition
End Sub
There may be an easier way to do this, but this was the only way that I
could figure out... The code works great when scrolling from record to
record, however it shows record 1 of 1 when the form loads and record 2 of
400 when I scroll to record #2. If I insert a break point at the point where
I set the value of strPosition the form loads with the correct value!
Does anyone have any ideas?
Thanks to all who have helped me in the past! I learn more by scrolling
through these groups in a couple o fhours than through weeks of classroom
training!
Jm