|
-
Mar 20th, 2003, 08:21 PM
#1
Thread Starter
PowerPoster
Counting Records *SOLVED*
Say i've got 154 records in my table and when I scroll through the records I want to be able to display which record it is and how many records there are in the table. New records are always added to the table so the total number of records needs to change when a new record is added.
In a label I want it to display something like.......002 of 154
Lintz
Last edited by lintz; Apr 9th, 2003 at 11:19 PM.
-
Mar 20th, 2003, 08:33 PM
#2
What re you using?
VB front end to a .mdb,
Access (VBA),
etc.
-
Mar 20th, 2003, 08:39 PM
#3
Thread Starter
PowerPoster
yeah, my app is linked to an Access DB.
-
Apr 9th, 2003, 06:48 AM
#4
Thread Starter
PowerPoster
Anyone got any ideas?? This is the code i've got but I can't get the current record number to display, only the record count is displayed.
Code:
Private Sub Form_Load()
Label52.Caption = Format("000") & " of " & Format(datPrimaryRS.Recordset.RecordCount, "000")
End Sub
-
Apr 9th, 2003, 09:13 PM
#5
Addicted Member
Unless you need the leading 0's, just use something like this.
VB Code:
me.rs.movenext
Label1.Caption = Str(Me.rs.AbsolutePosition) & _
" of " & Str(Me.rs.RecordCount)
-
Apr 9th, 2003, 11:18 PM
#6
Thread Starter
PowerPoster
I needed to put the code behind the Next and Previous cmd buttons. It is working just how I planned it. Thanks all for your suggestions.
Lintz
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|