conditional formatting of field on report

D

Donna

I have a report where it lists the number of meetings a person attended in
2005 in a text box titled "mtg2005." It lists the number of meetings a
person attended in 2006 in "mtg2006". Then it lists the monthly meetings
attended in 2007 in "MtgDate".

I am trying to figure out how to create a report that will somehow make
stand out the meeting date of a person's first meeting. I don't care about
2005 & 2006. This is an inherited database & I don't feel like going back &
entering all those dates in each person's name so I just did a count on those
years. But for this year and future years, I would like to have the date of
each meeting and be able to show which date is the first meeting they ever
attended. So far I have this in the on format eventof the detail section:

If Me.Mtg2005 Is Null Then
If Me.Mtg2006 Is Null Then
If Me.MtgDate.Properties.Count = 1 Then
Me.MtgDate.ForeColor = 255

Else
Me.MtgDate.ForeColor = vbWhite
End If
End If
End If

I get an error code that says an object is required.

Even if the code did work, however, the next month the report is run, if the
person attended that month also, the report would no longer highlight the
first meeting date because now the count would be 2.

Any ideas and help would be appreciated.
 
D

Duane Hookom

I don't quite understand what you are attempting to do but "Properties.Count"
will provide the number of properties associated with an object. For instance
a typical text box might have 52 properties.

Consider providing some sample records so we can visualize your report and
what you want to do.
 
D

Donna

FName LName 2005 2006 2007

John Doe 6 3 1/3/07

Mary Smith 1/3/07
2/17/07

Bill Clark 2/17/07


John Doe went to 6 meetings in 2005, 3 in 2006 and the 1/3/07 meeting.

Ideally, what I would like is for Mary Smith's 1/3/07 Meeting and Bill
Clark's 2/17/07 meeting to be bolded or font changed or something that would
make it stand out as their first meeting (2005 and 2006 are null). 1/3/07 is
the first meeting.
 
D

Duane Hookom

I'm not sure on your table structure but try:
1) create a text box in the detail section
Name: txtCount
Control Source: =1
Running Sum: Over Group
2) Add code in the On Format event of the detail section
If IsNull(Me.Mtg2005) And IsNull(Me.Mtg2006) And Me.txtCount =1 Then
Me.MtgDate.ForeColor = vbRed
Else
Me.MtgDate.ForeColor = vbBlack
End If
 
D

Donna

Thanks for the quick response.

It's actually a query containing 2 tables; one table has memberID & past
years 2005 & 2006 count of meetings (from an old excel spreadsheet). The
other table has the member ID & meeting dates they have attended.

The problem with me.txtcount = 1 is that if they attended 5 meetings in
2007, the first meeting they attended won't be highlighted because now the
count is 5. This report will be run many times through the year so it will
constantly be adding meeting dates for 2007. I need ONLY the first one to be
hightlighted.

So is there some count feature that would discern the FIRST one?
 
D

Duane Hookom

Donna,
Did you even try my suggestion?
If it doesn't work, then come back with your report's significant field
list, sorting and grouping, controls, etc.
 

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