Report name

G

Guest

I'm not really sure if this should be here or in another area, so forgive me
if it should be elsewhere. This is a bit complicated so this may be a long
post.

I have a report that is driven by a query. The query is based on a dynamic
table and pulls mailing list data. The underlying table contains contact
information for businesses, staff members, volunteers, clients, etc. Any
given person in the table could be in any one or more of those categories.
Each category has a checkbox and if the person is in that category, the box
is checked. There is a form on which each of the categories is represented
with a checkbox, so that if I want to pull contact information for only
Volunteers, I can check that box and run my report for only those people. I
can also pull multiple categories into the report, for example I can get a
list for those in volunteers or businesses and have a combined list. Now,
here's the question: How can I get the report to list (preferably in the
title) which lists it is made up of. For example, if I pull both Volunteer
and Business contact data, I would like the title to say "Master mailing list
- Volunteers, Businesses".

Any help is appreciated!
 
G

Guest

You can use a label control on the report. Then in the Open event of the
form, build the caption there based on which check boxes are checked on the
form:

Dim strListCategories As String
Dim frm As Form

Set frm = Forms!frmSomeForm

If frm!businesses Then
strListCategories = "Businesses"
End If

If frm![staff members] Then
If Len(strListCategories) > 0 Then
strListCategories = strListCategories & " And "
End If
strListCategories = strListCategories & "Staff Members"
End If

If frm!volunteers Then
If Len(strListCategories) > 0 Then
strListCategories = strListCategories & " And "
End If
strListCategories = strListCategories & "Volunteers"
End If

If frm!clients Then
If Len(strListCategories) > 0 Then
strListCategories = strListCategories & " And "
End If
strListCategories = strListCategories & "Clients"
End If

Me.lblCategories = strListCategories
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top