OnFormat in a report

RexesOperator

Registered User.
Local time
Yesterday, 21:15
Joined
Jul 15, 2006
Messages
604
Now that Wayne has solved one issue for me, I have another.

I have a text box txtCustomerProjecNumber that appears at the head of a report and at the top of each page. Not every customer has a project number, so I want it to be invisible when there is nothing to show.

The following code works on the ReportHeader but not on the PageHeader. Any ideas why? How do I get it to work on the PageHeader Section?


Private Sub PageHeaderSection_Format(Cancel As Integer, FormatCount As Integer)

If IsNull(txtCustomerProjecNumber) Then
txtCustomerProjecNumber.Visible = False
Else
txtCustomerProjecNumber.Visible = True
End If

End Sub


Private Sub ReportHeader_Format(Cancel As Integer, FormatCount As Integer)
If IsNull(txtCustomerProjecNumber) Then
txtCustomerProjecNumber.Visible = False
Else
txtCustomerProjecNumber.Visible = True
End If

End Sub
 
Does anyone know why this doesn't work on the pageheader section?
 
I have also tried setting the height and width properties to 0, but I still can't get this to work in the pageheader.
 
Why not use a group instead?
 
if you have a field

txtCustomerProjecNumber

appearing in both the report and page header, then they cant BOTH have the same fieldname (controlname) - check the pageheader again -its probably called field42 in there, or something similar
 
if you have a field

appearing in both the report and page header, then they cant BOTH have the same fieldname (controlname) - check the pageheader again -its probably called field42 in there, or something similar


Thankyou for the quote - I now realize I misspelled the fieldname! It is txtCustomerProjectNumber! Darn computers expect you to know what you're doing!
 

Users who are viewing this thread

Back
Top Bottom