?
Solved

MS access report  limit to 25 records

Posted on 2013-11-25
7
Medium Priority
?
406 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 38

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 38

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
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

Author Comment

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

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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Suggested Courses
Course of the Month13 days, 6 hours left to enroll

777 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