dbTalk Databases Forums  

HELP! Returning field names from checkboxes

comp.database.ms-access comp.database.ms-access


Discuss HELP! Returning field names from checkboxes in the comp.database.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
John Chiurato
 
Posts: n/a

Default HELP! Returning field names from checkboxes - 07-09-2003 , 09:26 AM






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

Reply With Quote
  #2  
Old   
Ira Solomon
 
Posts: n/a

Default Re: HELP! Returning field names from checkboxes - 07-09-2003 , 05:45 PM






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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.