Solved

MS access report  limit to 25 records

Posted on 2013-11-25
7
393 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 36

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 36

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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

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

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

Independent Software Vendors: 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!

Question has a verified solution.

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

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

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