Conditional Formatting Skips First Record??

databasedonr

Registered User.
Local time
Today, 15:11
Joined
Feb 13, 2003
Messages
163
Hi everyone.

I have a report where I read the value of a field in my query (a boolean) field, and if the value is true, I display two lines on my report, hide the lines if the value is false. Here's the code:

Private Sub Report_Page()

If Me.Flagged.Value = True Then
Me.Line102.Visible = True
Me.Line95.Visible = True
Else
Me.Line102.Visible = False
Me.Line95.Visible = False
End If


End Sub

This code works great.... except on the first page of the report! If I run the report in break mode, I can see that it evaluates my condition as "False" on the first record, regardless of the actual value in the field.

My report is based on a query that has some conditions in it, but, everything works correctly - except page 1.

I think this is weird, but if anyone can shed some light, I'd be grateful.
 
Try by putting in your code in the PageHeaderSection_Format event.
 
JHB, thanks, that worked fine. I appreciate that! Although, I do wonder why it didn't work on the first page, but only intellectually, as the report is due out the door, and now it works.

Thanks again, I appreciate the tip.
 

Users who are viewing this thread

Back
Top Bottom