Place this code in a module. Note that you will have to provide 12
parameters for the months, not just the 4 I did. You will have to
copy the code group to provide 12 pieces of code.
-----------------------------------
Public Function ListMonths(rt, j, f, mr, ap)
Dim mlist As String
Dim k As Integer
'rt is report type or name
'you would have to list all 12 months
mlist = ""
If Not j Then
If mlist = "" Then mlist = rt & " report is missing for "
mlist = mlist & "January, "
End If
If Not f Then
If mlist = "" Then mlist = rt & " report is missing for "
mlist = mlist & "Feb, "
End If
If Not mr Then
If mlist = "" Then mlist = rt & " report is missing for "
mlist = mlist & "March, "
End If
If Not ap Then
If mlist = "" Then mlist = rt & " report is missing for "
mlist = mlist & "april, "
End If
k = Len(mlist)
ListMonths = Left(mlist, k - 2)
End Function
--------------------------------------------------------------------
Your query would have just one column:
Missing: ListMonths(cb![report type],cb!jan,cb!feb,cb!mar,cb!april)
cb is the table name.
Again this will be much longer because you need all 12 months
Output is:
Missing
a report is missing for Feb, april
b report is missing for March
If you have further questions after Sat. please use e-mail. I will
not be checking newsgroups for a week after that.
Good Luck
Ira Solomon
On 9 Jul 2003 07:26:57 -0700, chiurato1 (AT) juno (DOT) com (John Chiurato)
wrote:
Quote:
I have an Access 2000 database that uses checkboxes to record received
monthly reports. I want to generate a querry that will return values
for the missing reports (Unchecked January, March and November to
report "Months missing are January, March and November"). How do I get
this field information to show other than a true/false or yes/no?
Thanks |