I have a report called "rpt_Outstanding_Maintenance_Requests" which has a simple On Click event procedure
-------------------------------
Private Sub Label8_Click()
Dim stDocName As String
stDocName = "rpt_Outstanding_Maintenance_Requests"
DoCmd.OpenReport stDocName, acPreview
End Sub
________________________________________
However, if there are no records in the table (i.e. this is the first record) it returns to the debug window which has the followinf code:
---Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FormatCount = 1 Then
Select Case Me![txt_Priority]
Case "Immediate"
'Red
Me![txt_Priority].ForeColor = RGB(255, 0, 0)
Case "Urgent"
'Orange
Me![txt_Priority].ForeColor = RGB(255, 102, 0)
Case "Routine"
'Default is Green
Me![txt_Priority].ForeColor = RGB(51, 204, 51)
Case Else 'Default
Me![txt_Priority].ForeColor = 0
End Select
End If
End Sub
----------
How can I make sure that this does not happen before the first record is entered please?
-------------------------------
Private Sub Label8_Click()
Dim stDocName As String
stDocName = "rpt_Outstanding_Maintenance_Requests"
DoCmd.OpenReport stDocName, acPreview
End Sub
________________________________________
However, if there are no records in the table (i.e. this is the first record) it returns to the debug window which has the followinf code:
---Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If FormatCount = 1 Then
Select Case Me![txt_Priority]
Case "Immediate"
'Red
Me![txt_Priority].ForeColor = RGB(255, 0, 0)
Case "Urgent"
'Orange
Me![txt_Priority].ForeColor = RGB(255, 102, 0)
Case "Routine"
'Default is Green
Me![txt_Priority].ForeColor = RGB(51, 204, 51)
Case Else 'Default
Me![txt_Priority].ForeColor = 0
End Select
End If
End Sub
----------
How can I make sure that this does not happen before the first record is entered please?