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 
Add blank records to a report
Daniel Schewe 
    
3 years ago
I have a report that I created that prints out an inventory list. It was made to look like a Department of the Army form. It has lines that grid the page to enter items. However, my report only shows populated records and the rest of the page is blank until you get down to the footer. I'm trying to insert blank grids (or empty records) to keep the report uniform whether it has 5 items in it or 25. Can anyone help? Thanks
Kevin Robertson  @Reply  
          
3 years ago
One possible solution to your problem is to use a temporary table that has the same structure as your inventory table, but with 25 empty records. You can then append the records from your inventory table to the temporary table using an append query. This way, you will always have 25 records in your report, regardless of how many items you actually have in your inventory. You can use Access VBA to create and populate the temporary table before opening the report, and delete it after closing the report. Here is an example of how you can do this:

'Create a temporary table with 25 empty records
Dim db As Database
Dim rs As Recordset
Dim X As Integer

Set db = CurrentDb
db.Execute "CREATE TABLE TempInventory (ItemID Long, ItemName Text, ItemQuantity Long)"
Set rs = db.OpenRecordset("TempInventory")

For X = 1 To 25
    rs.AddNew
    rs.Update
Next

rs.Close
Set rs = Nothing


'Append the records from the inventory table to the temporary table
db.Execute "INSERT INTO TempInventory (ItemID, ItemName, ItemQuantity) SELECT ItemID, ItemName, ItemQuantity FROM Inventory"

'Open the report based on the temporary table
DoCmd.OpenReport "InventoryReport", acViewPreview

'Delete the temporary table after closing the report
DoCmd.Close acReport, "InventoryReport"
db.Execute "DROP TABLE TempInventory"

db.Close
Set db = Nothing
Kevin Yip  @Reply  
     
3 years ago
One way to do this is put your report as a *subreport* on another report, then put lines, boxes, etc., on top of that subreport.  The picture below shows the design view and the print preview result.  The tricky thing is have to your subreport line up perfectly with your lines and boxes.  This is made trickier since the horizontal ruler of the subreport is slightly off to the right of the main report's horizontal ruler.  The lines and boxes will always be on top of the subreport, and you don't really have to use "Send To Front" for them.

When there is no record, the detail section doesn't exist on the report, so that's why you can't put anything on the detail section when that happens.  This is quite a common problem, and I experienced this a lot in my old job.
Kevin Yip  @Reply  
     
3 years ago

Daniel Schewe OP  @Reply  
    
3 years ago
Thanks for the advice. I'll try both techniques tommorrow.

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: 6/14/2026 1:35:09 AM. PLT: 1s