Solved

MS access report  limit to 25 records

Posted on 2013-11-25
7
388 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
  • 4
  • 3
7 Comments
 
LVL 35

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 35

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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

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

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
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…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

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