Runtime Error on Detail Format Event

B

Brennan

Hello:

I am using the following code to change the color of a
detail record if a certain condition is met.

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

If [tblBids_Status] = "Pending-GC Has Job" Then
[tblBids_JobID].ForeColor = vbGreen
[tblJobs_JobName].ForeColor = vbGreen
[tblJobs_JobLocation].ForeColor = vbGreen
[tblBids_BidID].ForeColor = vbGreen
[tblBids_BidAmount].ForeColor = vbGreen
[tblBids_DateDue].ForeColor = vbGreen
[tblbids_Contact1].ForeColor = vbGreen
[tblContractors_Phone].ForeColor = vbGreen
[tblEstimators_Name].ForeColor = vbGreen
[tblBids_Status].ForeColor = vbGreen

ElseIf [tblBids_Status] = "Pending-GC Not Awarded" Then
[tblJobs_JobName].ForeColor = vbBlack
[tblJobs_JobLocation].ForeColor = vbBlack
[tblBids_BidID].ForeColor = vbBlack
[tblBids_BidAmount].ForeColor = vbBlack
[tblBids_DateDue].ForeColor = vbBlack
[tblbids_Contact1].ForeColor = vbBlack
[tblContractors_Phone].ForeColor = vbBlack
[tblEstimators_Name].ForeColor = vbBlack
[tblBids_Status].ForeColor = vbBlack


End If

End Sub


When I run the report, I get the following error:

Runtime Error 438
Object doesn't support this property or method

The debugger highlights the following line of code:

[tblBids_JobID].ForeColor = vbGreen

I have checked the field names several times and they are
correct. This code also works on another report that I
have.

Any suggestions on how to resolve this problem would be
appreciated.

Brennan
 

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