Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Continuous Form
Kim Boren 
      
15 months ago
Hello,
I am working with a continuous form. I would like to open this form from a main menu. I would like the form to open to the last five records and be in position to add a new record. Any help would be appreciated.
Kim
Kevin Robertson  @Reply  
          
15 months ago
You can try something like this:

    Dim X As Long
    
    DoCmd.OpenForm "CustomerListF", , , , acFormEdit
    DoCmd.GoToRecord acDataForm, "CustomerListF", acLast
    Forms!CustomerListF!FirstName.SetFocus
    
    X = 1
    DoCmd.Echo False
    While X < 5
        DoCmd.GoToRecord acDataForm, "CustomerListF", acPrevious
        X = X + 1
    Wend
    DoCmd.Echo True
    DoCmd.GoToRecord acDataForm, "CustomerListF", acNewRec
Kim Boren OP  @Reply  
      
15 months ago
Perfect Kevin,

Thank you very much.

Kim
Kevin Robertson  @Reply  
          
15 months ago
You're welcome.
Stanley Mc Keown  @Reply  
     
15 months ago
I have a continuous form as a child to a main item form.
The continuous form lists maintenance history events of the master form and is bound to a separate history table where all items history are listed chronologically.
  The item form has it's own item table.

I'm wondering would the above code or a similar approach to the problem work to limit the continuous form to the last 10 records?
Kevin Robertson  @Reply  
          
15 months ago
To select the Top X of a Recordset is much simpler.

For Example:
    Me.RecordSource = "SELECT Top 10 * FROM OrderListQ ORDER BY OrderTotal DESC"

To get the Last 10 records (sorted descending by ID)
    Me.RecordSource = "SELECT Top 10 * FROM OrderListQ ORDER BY OrderID DESC"

Top X
Stanley Mc Keown  @Reply  
     
15 months ago
Thanks Kevin -- this works after a fashion -- but in my case the top 10 are the top 10 of the total history file and because the id field is linked to the master form you get only some of the records instead of 10 since id's of other items  are in that history file.
Stanley Mc Keown  @Reply  
     
15 months ago
I didn't put "Me." In the record source property since I'm already in the record source property of the continuous form. Is that why I need the "Me."?

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

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: 5/2/2026 9:17:18 AM. PLT: 1s