Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Help   Contact   Merch   Join   Order   Logon   Forums   
 
Back to Access Developers    Comments List
Upload Images | @Reply | Bookmark | Link | Email | Next Unseen |
Help with Reports Layout and Functionality
Debbie Heaney 
     
16 days ago
I think i pressed a wrong button early and didn't actually post this?
Can i do it right this time?

I can do with some help with building a report.
Not being good at just using words, and this needing a few screenshots, I've put it into a video that will hopefully be enough as explain what I currently have versus what I would like.
Richard Rost  @Reply  
           
16 days ago
Hi Debbie. Your post came through. I understand that showing the problem can be easier than describing it, and we do want to help. For this question and future posts, though, please upload screenshots here rather than linking to a video. Screenshots let everyone see what's going on at a glance. Watching a separate video takes extra time that many of the people helping here don't have.

I also generally don't allow external links because we've had people post inappropriate material in the past. That's a general forum rule, not a criticism of your video. A few screenshots showing what your report looks like now and what you'd like to change, with a short note under each, would be a good way to continue.
Debbie Heaney OP  @Reply  
     
16 days ago
Starting with the data input side of things. The "Daily Booking Sheet" section is the main form, an After Update event for both Time Out and Time In runs a DLookup to get what I am calling the "Time Window". A period of time within which the customer came in/out.
Debbie Heaney OP  @Reply  
     
16 days ago

Debbie Heaney OP  @Reply  
     
16 days ago
From this data I would then like to  create a report to summarize and count up how many customers came and went with a time window.
I have two basic reports that do the job. Whilst these would be enough if it was just me using them it's not very user friendly for others to use. Once this is integrated into the main project it will be used by 8 others with varying degrees of confidence in using computers.
(Doing this a standalone for now so as not to risk the main project)
Debbie Heaney OP  @Reply  
     
16 days ago

Debbie Heaney OP  @Reply  
     
16 days ago
What I would like is a report that looks something like this spreadsheet.
Grouped by date, listing all the time window, next to that the count of customers going out, customers coming back back and the total for that time window.
Ignore the grayed out lines, those are there purely for me and checking the numbers all match up, this is not needed in the real thing.
Debbie Heaney OP  @Reply  
     
16 days ago

Debbie Heaney OP  @Reply  
     
16 days ago
The part I am having difficulty with is trying to make a report that looks like the spreadsheets.
No matter what I try it turns out a mess of numbers. Making sense of this jumble is possible but it take work.
each time window is listed 3 times.
Debbie Heaney OP  @Reply  
     
16 days ago

Debbie Heaney OP  @Reply  
     
16 days ago

Debbie Heaney OP  @Reply  
     
16 days ago
The Report settings above. A nice option to have would be the ability to change the report grouping based on user input.
Debbie Heaney OP  @Reply  
     
16 days ago
Then the query behind that. I've tried different relationships and join types. different fields selected, different ordering of the fields, so many other things I've lost track. I just can't get it to the point of being usable by others.
Debbie Heaney OP  @Reply  
     
16 days ago

Debbie Heaney OP  @Reply  
     
16 days ago
I think that's all the main point of interest?
John Davy  @Reply  
         
16 days ago
Hi Debbie, Just so I understand = Can you tell me what is WindowOut and WindowIn and why WindowOut is earlier than WindowIn? And explain WindowIn and WindowOut. I am just trying to understand. Thanks John
Debbie Heaney OP  @Reply  
     
16 days ago
I am part of a small charity that hires out mobility equipment for the day.
We keep track of when people come in to start a hire (Time Out) and when they return the equipment to end the hire (Time In)

The "WindowOut" is the the time they started the hire. A customer arriving at 9:15 to start the hire is doing so within "WindowOut=1". They started the hire sometime between 8:45am and 9:29 am.
Then at the end of their time out the return with a window of time. returning at 10:00 is withing "WindowIn=2". They returned some time between 9:30 am and 10:29am.
Richard Rost  @Reply  
           
16 days ago
Thanks for the screenshots, Debbie. They make the problem much clearer. I'd get the query right before changing the report layout.

Your last screenshot shows no join between TimeWindowT and DailyBookingsT. That combines each time window with every booking. You're also grouping by both OutWindowID and InWindowID, which produces separate rows for different out/in combinations rather than one row per time window.

Keep your two separate count queries. Each should return one row per date and window: one counts departures, the other counts returns. To include the zero rows shown in your spreadsheet, first make a list of each reporting date paired with all nine time windows. Then use outer joins from that list to the two count queries, matching BOTH the date and window ID. Missing counts can become zero with Nz, and Total is OutCount plus InCount. My Outer Joins video explains keeping rows that have no matching records.

Once that query shows one row per date/window, use it as the report's Record Source, group by UseDate, and sort by WindowID. I'd leave user-selectable grouping until those counts match your spreadsheet. Also, that Total counts movements, not distinct customers: someone leaving and returning in the same window contributes two.
Debbie Heaney OP  @Reply  
     
15 days ago
I think I'm getting there? Not got it 100% yet but it is the closest I've gotten so far.
Just the Nz bit to figure out.
Screenshots coming up.
It is the movement count I/we are looking for and not distinct customers. Every once in a while we get asked for these numbers. As to why management want them is above my pay grade but my guess is for things like planning staffing levels. Do we really need two, or more, staff on duty in the same office? Do they need to be on duty all day? At what point does the number of customers become managable by one person?
Debbie Heaney OP  @Reply  
     
15 days ago

Debbie Heaney OP  @Reply  
     
15 days ago

Debbie Heaney OP  @Reply  
     
15 days ago
Query 1 = the first list with dates and all time windows.
Query 2 - is the output from joining the two separate courting queries. This i think is the bit that i was missing? I've seen the output from Query1 before but didn't know what to do with it.
Query 2 need to sit inbetween that and the two count queies.
Debbie Heaney OP  @Reply  
     
15 days ago
This is looking a little better still. I missed the join between TimeWindowT and DailyBookingsT
Debbie Heaney OP  @Reply  
     
15 days ago

Debbie Heaney OP  @Reply  
     
15 days ago
Time to take a break. I'm close but still so far?
Debbie Heaney OP  @Reply  
     
15 days ago

Richard Rost  @Reply  
           
15 days ago
You're getting closer, Debbie. The repeated rows are already in Query1, so I'd fix that before working on the report or Nz.

Create a small query from DailyBookingsT containing ONLY UseDate, with the query's Unique Values property set to Yes. Save it as BookingDatesQ. This gives you each booking date once.

In Query1, replace DailyBookingsT with BookingDatesQ. Keep TimeWindowT, but leave these two sources UNJOINED deliberately. This step pairs each distinct date with all nine windows. It should produce nine rows per date, with no repeated date/WindowID pairs. Pairing the windows with every booking instead repeats the dates.

Your Query2 screenshot shows the next step: outer joins from Query1 to each count query on BOTH date and window ID, keeping all Query1 rows. Each count query must also have only one row per date/window. Display UseDate, WindowID, WindowOut and WindowIn from Query1, not from either count query. Otherwise a missing count can leave the date or window blank.

For the blanks, add calculated fields in Query2 using new names:
OutQty: Nz([OutCount],0)
InQty: Nz([InCount],0)
TotalQty: Nz([OutCount],0)+Nz([InCount],0)

Use those fields in the report. Nz changes missing counts to zero, but it won't remove duplicate rows. Check one date in Query2 first: nine windows, each listed once, with counts matching your original two count queries.
Debbie Heaney OP  @Reply  
     
14 days ago
I go it. A quite day at work, unusually quite, gave me time to work on it. If anything the interruptions of doing the job helped. It's hard to explain but I got more done in the 7.5 hour work day than I did all weekend.
I fell for a number formatted as string issue but even with working i solved it fairly quickly. I'm about to upload the working report then this bit will make sense.
I'm seeing totals like 20,13,10. the numbers made no sense. Until the realization of what was happening.
Now that it work it needs integrating into the main project.
Debbie Heaney OP  @Reply  
     
14 days ago

Debbie Heaney OP  @Reply  
     
14 days ago
Then the two main main queries driving the report.
The bit i was missing was "Query 2". I was starting to think I needed something to sit between "Query 1" and the two calculation queries but no idea what or how.
I would have never, ever, though on joining on Both the Date AND WindowID either.
The manager was in to day so when I let out a little squeal of excitement upon my success it got his attention and I was able to show him. He likes it.
Debbie Heaney OP  @Reply  
     
14 days ago

Debbie Heaney OP  @Reply  
     
14 days ago

Debbie Heaney OP  @Reply  
     
14 days ago
Richard, your idea of using a query to create the unique list of dates sounds interesting. I hadn't thought of that.
A task for tomorrow.
Thursday (then most of next week) this project is getting moved to the back burner for a while, especially now this bit works.
I'm going to be playing a remake of the best video game ever made.
The Legend of Zelda: The Ocarina of Time.
Richard Rost  @Reply  
           
14 days ago
Glad you got it working, Debbie. Thanks for coming back with the result and screenshots. Catching that text-versus-number issue yourself is good progress, and it's nice that your manager got to see the payoff too.

Keep a backup of this working version before integrating it into the main project. Enjoy your Zelda break.
Debbie Heaney OP  @Reply  
     
13 days ago
I keep every iteration of my projects. That bit works so back it up then advance the build number.
The main project is on it's 33rd increment, copy that, increment to 34 then add this.

Now that this works is there an easy-ish way to allow my team mates to pick the grouping level?
I can certainly image group by week and group by month being nice options; if I'm adding those then adding group by years whilst I'm at it makes sense.
If not then I can do separate reports for each level.
Debbie Heaney OP  @Reply  
     
13 days ago
It's still a work in progress but I've got the basics working? Pick an option from the list box and the report opens with the grouping.
Need to figure out how to get the date range in there when view periods more than a day.
Such as (UK formatting here) 01/11/2026 - 08/11/2026 for weekly.
Or 01/11/2026 - 30/11/2026 for monthly.
That sort of thing.
Need to figure out page breaks too. Things get broken across two page, or everything on its own page.
Debbie Heaney OP  @Reply  
     
13 days ago

Debbie Heaney OP  @Reply  
     
13 days ago

Richard Rost  @Reply  
           
13 days ago
Nice progress, Debbie. Your screenshots show the list box changing GroupOn. That changes which records belong together, but the date text box still needs its own expression to display the period's boundaries.

I'd put that calculated text box in the date group header and have its expression follow the same day/week/month choice. For a month, DateSerial(Year(D), Month(D), 1) gives the first day, and DateSerial(Year(D), Month(D) + 1, 0) gives the last. Replace D with your report's date field and format each result as dd/mm/yyyy, joined with " - ". My First Day of Month video covers both calculations. Use the dates from the group, not today's date.

For weeks, make the label use the same starting weekday as the report's grouping, then add six days for the inclusive end date. A seven-day week starting 01/11/2026 ends 07/11/2026. Avoid using just the earliest and latest booking dates if you want the full calendar period, since days without bookings can shorten that label.

For the page breaks, check two separate settings in Design View. In Group, Sort, and Total, expand More for the relevant group and try keeping the whole group together on one page. That works only when the group fits; for longer groups, keep the header with the first detail instead. Also check Force New Page on the report sections and any manual page-break controls. Leave Force New Page at None unless you deliberately want each group to start a new page. My Force New Page video shows how forced group breaks work. Test the results in Print Preview.
Debbie Heaney OP  @Reply  
     
12 days ago
The delivery of the video has been delayed until tomorrow, and I'm working tomorrow. (Boo)
Gives me a bit more time to play with this.

Over on the main project I have a form for configuring dates before opening reports. I should be able to tap straight into that during the integration process. (screenshots incoming)

My plan for today
(1) I need to test the groupings. That's going to need data. Generate 2 years (or near about) of play data.
(2) two query names are not very descriptive. Some field names are a bit confusing too? Tidy all that up.
Debbie Heaney OP  @Reply  
     
12 days ago

Debbie Heaney OP  @Reply  
     
12 days ago

Debbie Heaney OP  @Reply  
     
12 days ago
Another issue with the counting.
The picking the group works....sort of.
The counting is off.
The totals in the pink band are correct, but the total per window are incorrect.
In the following screenshot I have things grouped by month.
For month starting 01/11/2026 and month starting 01/12/2026 total going out for time window 09:30 - 10:29 should be 30, like wise for the Coming in total for window 11:30 - 12:59

All other grouping are similarly affected. Weekly shows 7 in the total but only 1 for the window.
Year shows 365 in the totals but just 1 in the window.
Debbie Heaney OP  @Reply  
     
12 days ago

Richard Rost  @Reply  
           
12 days ago
Debbie, the correct pink totals are a useful clue. Changing GroupOn groups the dates, but it doesn't automatically turn each window's displayed count into a total for that period. Your screenshot looks consistent with a window showing one daily value instead of the sum of its daily values.

Keep the working query with one row per date and window. In the report, use the selected date period as the outer group, then add a WindowID group inside it. A sort on WindowID alone isn't the same as a group.

Put the window labels and numeric totals in that inner group's header or footer. For example, using the earlier field names, the Control Sources would be =Sum([OutQty]) and =Sum([InQty]). Use your current numeric field names if you've renamed them. Hide the Detail section once those sums work, so each window appears once per period. Keep the pink period totals in the outer group's footer.

Use Sum, not Count: you're adding the counts already calculated by the daily query, not counting its rows. Test one week first. Seven daily values of 1 in the same window should show 7 in that window's subtotal.

If that doesn't match your current layout, post Design View with Group, Sort, and Total expanded, plus the Control Source of one incorrect count box. That will show which grouping level currently owns it.
Debbie Heaney OP  @Reply  
     
11 days ago
Thanks for that Richard.
I was on the right lines with what the problem was but couldn't figure out the fix.
My dad was taken to hospital last night so I don't have much head space left to understand your instructions right now.
But I know where to come back to when I'm ready.
Richard Rost  @Reply  
           
11 days ago
I'm sorry to hear about your dad, Debbie. Don't worry about the report right now. Family comes first.

I hope everything turns out OK. We'll be here when you're ready to pick this back up.
Debbie Heaney OP  @Reply  
     
8 days ago
Dad is okay. 72 years old + history of various health issues = more health issues.
Anyway, back to learning.
Debbie Heaney OP  @Reply  
     
8 days ago
Thank you Richard, I know have a working report.
My Last Screenshot I maybe should have showed the design view, I already had the inner group set to <code>WindowID</code> so was definitely on the right line.
The bit that was confusing me was the <code>Sum</code> bit.
after reading your instructions a couple of times and comparing it to what I had it just clicked.

Debbie Heaney OP  @Reply  
     
8 days ago

Kevin Robertson  @Reply  
          
8 days ago
Debbie I liked your report so much I just had to do my own version.
Kevin Robertson  @Reply  
          
8 days ago

Debbie Heaney OP  @Reply  
     
7 days ago
Kevin and a very nice version it is.
I just love how the same thing can be done is so many different ways.
Debbie Heaney OP  @Reply  
     
7 days ago
Richard I have this integrated into the main project and working, now I'm working on tidying things up for the end users.

After some debating with myself on how I want it too look I've decided on the displayed date ranges as mentioned earlier.

I'm not understanding the date range bit. Where do I put the expressions? How do I get it to follow the selected grouping?
Kevin Robertson  @Reply  
          
7 days ago
Debbie Is it something similar to this (see screenshot)?
Kevin Robertson  @Reply  
          
7 days ago

Debbie Heaney OP  @Reply  
     
6 days ago
Indeed it is something like that Kevin. If it was just me using it then I would leave it as is, i can work with that.
But for my colleagues I think showing the date ranges would make it easier for them to undestand
For weeks then showing something like 01/11/2026 - 07/11/2026 then 08/11/2026 - 15/11/2026
Then months would be 01/11/2026 - 30/11/2026 then 01/12/2026 - 31/12/2026.
And so on foe Quarters and Years.
I understand the math of DateSerial() just not how to use it in this project. I haven't done a lot of work (until now) with reports so I'm still learning some of their quirks.
Debbie Heaney OP  @Reply  
     
6 days ago
Here's what I've managed so far. The Report View then the "Select Date Range" form used to set the options for things.
Debbie Heaney OP  @Reply  
     
6 days ago

Debbie Heaney OP  @Reply  
     
6 days ago

Kevin Robertson  @Reply  
          
6 days ago

Richard Rost  @Reply  
           
3 days ago
Sorry for not getting back to you sooner, Debbie. I've been out of the office all week. Glad you've got the totals working.

The missing piece is where to put the expression. In report Design View, select the date text box beside "Period Starting" in the outer date group header. Open its Property Sheet, go to the Data tab, and put the calculated expression in Control Source. It belongs in a text box, not the caption of a label.

Get the monthly version working there first. Then, in the existing Report_Open event where you change GroupOn, use that same grouping selection to choose the text box's Control Source expression. A Select Case can select the day, week, month, quarter or year expression. Changing GroupOn doesn't change the displayed date expression automatically.

Assign an expression that refers to the report's date field, rather than calculating one fixed date string when the report opens. That lets Access evaluate the label for each group. Keep the overall start/end filter dates in your report title separate from these individual group labels.

For your Sunday-to-Saturday examples, the second week would be 08/11/2026 through 14/11/2026. Align the starting date with the report's week boundary, then add six days for the inclusive ending date. Test one grouping option at a time in Print Preview before adding the next.
Add a Reply Upload an Image
Next Unseen

 
 
What's This?

 

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: 11/17/2026 2:28:24 AM. PLT: 0s