Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Developers    Comments List
Upload Images | @Reply | Bookmark | Link | Email | Next Unseen |
Displaying Records in a Subform
Robert Braga 
      
2 days ago
I'd like to go to a record in a continuous subform, but not put that record at the top of the form.  I'd like it to show maybe the 4 records above it.  Richard showed how to do this in one of his videos but I can't remember which one. I don't know if it was a class or a tech help video.  Does this sound familiar to anyone?  Thanks, Bob
Donald Blackwell  @Reply  
       
2 days ago
He does this in his Fitness Series - Fitness 35

Kevin Yip  @Reply  
     
2 days ago
Access doesn't know what is visible on the screen at any given time, so it cannot "position" the row for you that way.  But you can use a trick to solve this.  Use a bookmark (a recordset's property) to remember your row's location.  Move to the last row.  Then move back to your bookmarked row.  Your row should now be shown as the top row on the screen.  Move up 4 rows.  Then move back to your bookmarked row.  Your row should now have 4 rows above it.  If there are fewer than 4 rows above it, this method will show whatever that is available to show without any error.  If you haven't already, take Richard's lessons on bookmarks.  The other posters will guide you to which videos to watch, since I'm unfamiliar with his courses.  If Richard hasn't done a video on "positioning" a row on the screen in this manner, I would suggest he do a Tech Help video on this.
Kevin Yip  @Reply  
     
2 days ago
Here is the VBA code to do the above:

Dim frm As Form, bm As Variant

' Store your subform in variable frm
Set frm = Forms![Your Main Form Name]![Your Subform Name].Form

' Go to your desired row on subform however you prefer, such as with FindFirst
frm.Recordset.FindFirst "[customerID] = 100"  ' Criteria for your row

' Store your row in a bookmark
bm = frm.Bookmark

' Move to last row
frm.Recordset.MoveLast

' Move back to your row using bookmark
frm.Bookmark = bm    

' Move up 4 rows
frm.Recordset.Move -4

' Move back to your row using bookmark
frm.Bookmark = bm  


This way, there will always be up to 4 rows above your selected record UNLESS your selected record is near the bottom of a long list, in which case Access cannot scroll down far enough to show only 4 records above yours.
Robert Braga OP  @Reply  
      
2 days ago
Thanks Kevin and Donald, I'll check out Fitness 35 and this vba code tommorow.  Thank you for getting back to me so quickly.
Add a Reply Upload an Image
Next Unseen

 
 
What's This?

 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 10/1/2026 1:26:29 PM. PLT: 0s