Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format event in reports 2

Status
Not open for further replies.

primerov

Technical User
Aug 16, 2002
160
BG



I have a report enumerating the invoices per customer.In the Format event
of the report i have put the condition that if the control called invoicenumber
is 0, then the control CompanyName must be red.I receive no error message
but the control CompanyName is not made red.
What is the error in my command ?


Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me![invoicenumber] = 0 Then
Me![CompanyName].ForeColor = 255
End If
End Sub
 
You are also going to want to continue the code to reset the color back when [invoicenumber] <>0 :
Code:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me![invoicenumber] = 0 Then
   Me![CompanyName].ForeColor = VbRed
Else
   Me![CompanyName].ForeColor = VbBlack
End If
End Sub


Hoc nomen meum verum non est.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top