Forum Discussion
Inherited a Access databse, cant get it to generate multiple reports off a date range.
Thank you, although that query is, in turn, based on another query called Employeesqry, it doesn't appear to be limiting the number of records returned to only one. Perhaps the problem is in that source query; can you show that SQL as well?
Also, it would be helpful to confirm that there are multiple records returned. How many records does it return when run as a stand-alone query?
I see nothing here that would create a report. How does that part work? Is that what the button on the form is supposed to do? We need to see that VBA as well.
Here is the SQL for Employeesqry:
SELECT AllEmployeesqry.BadgeIDNumber, AllEmployeesqry.[Personnel Number], AllEmployeesqry.[Position #], AllEmployeesqry.[Job Title], AllEmployeesqry.[Full Name], AllEmployeesqry.Post, AllEmployeesqry.Unit, AllEmployeesqry.Location, AllEmployeesqry.Zone, AllEmployeesqry.Onshift, AllEmployeesqry.[Accounted for:], AllEmployeesqry.Status, AllEmployeesqry.[Separation Date], AllEmployeesqry.[Holiday Off], AllEmployeesqry.Shift, AllEmployeesqry.[Start/End Time], AllEmployeesqry.RDO, AllEmployeesqry.WorkSites, AllEmployeesqry.Perimeter
FROM AllEmployeesqry
WHERE (((AllEmployeesqry.Status)="Active" Or (AllEmployeesqry.Status) Is Null) AND ((AllEmployeesqry.[Separation Date]) Is Null)) OR (((AllEmployeesqry.[Separation Date])>Date()));
This is the VBA for the form. there isnt mush to reference to inside of VBA at all. most of it looks like this.
Option Compare Database
Private Sub Command7_Click()
End Sub
I am trying to provide as much info as I can.
- George_HepworthDec 20, 2023Silver Contributor
No need to apologize. You aren't responsible for knowing everything, all at once, the first time.
That query also should still return all employees which satisfy the criteria.
That VBA is actually nothing but an empty sub which does nothing!
So, the problem is elsewhere. I made an assumption early on that we need to validate. I assumed you were creating the reports from a procedure in a form. But that can't be the case on the basis of what we see so far. So, it's on me for having leapt to a conclusion.
How do you create the reports? Step by step if you can.