Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim db As Database
Dim tbl As TableDef
Set db = CurrentDb
Set tbl = db.TableDefs("Documents")
Me.txtRecordNum.Value = "Record " & Me.CurrentRecord & " of " & tbl.RecordCount
Set tbl = Nothing
Set db = Nothing
If Not Me.NewRecord Then
Me.Caption = "Record " & CurrentRecord & " Of " &
RecordsetClone.RecordCount & " Records"
Else
Me.Caption = "Record " & CurrentRecord & " Of " &
(RecordsetClone.RecordCount + 1) & " Records"
End If
Me.Caption = "Record " & CurrentRecord & " Of " &
(RecordsetClone.RecordCount + 1) & " Records"
The only problem I see with this code is that when a user clicks on the button to add a new record, the record index is 1 higher than the record count. For example, if there are 3 records in the table, and the add new record button is clicked, it displays "Record 4 of 3".
My code addresses the problem rjoubert mentioned in his 2nd posting. It simply shows "Record 4 of 4" instead of "Record 4 of 3." It is the right count if the record is added. If the record is tossed it reverts back to the correct count.
After reading your post, I'm begining to understand how so many people who have had classes with "Instructors" and still have no idea about how to work with Access.
The Missinglinq
There's ALWAYS more than one way to skin a cat!