Solved

MS access report  limit to 25 records

Posted on 2013-11-25
7
398 Views
Last Modified: 2013-12-05
Of course I'm doing something wrong

Private Sub Report_Open(Cancel As Integer)
  
Dim TotalRec1 As Long

TotalRec1 = DCount("OfferDetailID", "Offer Details", "OfferDetailID" = "(-1)/25")

End Sub

Open in new window

0
Comment
Question by:mvdwal
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 37

Expert Comment

by:PatHartman
ID: 39675693
To limit the records selected, use a query.  The TOP predicate will limit the results to the Top n records.  N is not a variable though.  It is hard-coded in the query and you can't change it at runtime.  If you need n to be variable, you need to build the SQL string on the fly rather than using a querydef.

Right click on the gray background in the QBE to open the properties window.
TopValues.JPG
0
 

Author Comment

by:mvdwal
ID: 39675732
Dear Pat Hartman, Thanks for helping me out.

I use images in a report. If there are more than 30 or 35, then the images in the report empty. That's why I like: one report for the firts 25 records, another report for the next 25 records 25 to 50.
0
 
LVL 37

Expert Comment

by:PatHartman
ID: 39675968
Didn't I just see an answer to this problem?  Do you have another thread going?  I believe the answer involved a code loop and getting 25 images at a time.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:mvdwal
ID: 39676037
No no answer yet
0
 
LVL 37

Expert Comment

by:PatHartman
ID: 39676172
So, you have another thread going?
0
 

Accepted Solution

by:
mvdwal earned 0 total points
ID: 39676697
Yes I have another thread going. But no solution yet.
here's the thread
0
 

Author Closing Comment

by:mvdwal
ID: 39697810
The solution is in the other thread
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question