Need help formatting an Access report from a query and SQL help
December 20, 2010 6:58 AM Subscribe
I'm having trouble formatting a report in Access that ONLY shows checkboxes that are not checked. I probably need some help on the SQL front.
My database is based around a list of tasks. When the person finishes a task, they check it off. I want a report of ONLY the tasks which are incomplete, so I have a query along the lines of this:
SELECT Projects.ProjectID, Projects.ProjectName, Projects.Check01, Projects.Check02, Projects.Check03
FROM Projects
WHERE (((Projects.Check01)=No)) OR (((Projects.Check01)=No)) OR (((Projects.Check01)=No));
This gives me a list of projects for at least one task is not complete. For example, for project "Grocery Shopping," I clipped the coupons but did not make a list or go to the store.
All I want to show on the report is that I still need to make a list and go to the store. So in my report code, I have
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Check01 = False Then
Check01.Visible = True
Else
Check01.Visible = False
End If
If Check02 = False Then
Check02.Visible = True
Else
Check02.Visible = False
End If
If Check03 = False Then
Check03.Visible = True
Else
Check03.Visible = False
End If
End Sub
This gives me a blank line where "clipping coupons" would be, because I've finished that task. Is there a way to eliminate the blank lines? I have 25 tasks per project (this is stable, and all of the tasks are the same for every project) so if half of them are finished, the page looks horrible. I would be fine with almost any kind of list (text file, whatever) as long as it ONLY shows the incomplete tasks in some sort of coherent form. I'm using Access 2002 if it matters, but I'll probably be getting 2007 or 2010 soon.
posted by desjardins to computers & internet (4 answers total) 1 user marked this as a favorite
_PROJECT________|__TASK________|_CompletedCheck________
-----------------------------------------------------------
Grocery Shopping__|_Clip Coupons__|_-1
Grocery Shopping__|_Make List_____|_0
Grocery Shopping__|_Go To Store___|_0
When you start a project, you can use a simple append query to add all the tasks.
Then your query can be
SELECT Projects.ProjectID, Projects.ProjectName, Projects.Task
FROM Projects
WHERE (Projects.CompletedCheck = False).
In the report, add the fields then Group By ProjectID, ProjectName.
The reports are much prettier in later versions of Access.
posted by Acheman at 7:25 AM on December 20, 2010