Hello All,
I have a report where it lista employees that need to have an eval done in the next 30 days.
If the employee has a 3 month, 6 month or 12 month eval due in the next 30 days it lists the employee name, 3 month eval due date, 3 month eval score, 6 month eval due date, 6 month eval score, and 12 month eval due date and score. I would like the report to bold or highlight either the 3, 6 or 12 month eval due date that made teh ee hit the report criteria, and I cannot seem to get to to work ... So for each ee in the list one of the due dates would be in BOLD or have a red background... (Which i have tried in the ON Open event of the form.
here is my code...
[CODE=vb]Private Sub Report_Open(Can cel As Integer)
Dim strDivision As String
Dim strTerm As String
Dim strEmpType As String
Dim dteCurrentdate As Date
'Open the form to get the variables
DoCmd.OpenForm "SelectReportCr iteriaEval", acNorman, , , , acDialog
' Get the Seleceted Values
strDivision = Nz(Forms("Selec tReportCriteria Eval")!selDivis ion, " ")
strTerm = "N"
strEmpType = "Temp"
dteCurrentdate = DateAdd("m", 1, Date)
'MsgBox "strDivisio n = " & strDivision
' Set the recordsource for the report
If strDivision <> "ALL" Then
Me.RecordSource = "SELECT * FROM Main_EE_Info " & _
"WHERE Division = '" & strDivision & "' " & _
"AND EmpType LIKE '[" & strEmpType & "]*' " & _
"AND Terminated Like '" & strTerm & "' " & _
"AND ((The3MEvalDate <= #" & dteCurrentdate & "# AND The3MEvalScoreF lag = 'N') OR " & _
"(The6MEval Date <= #" & dteCurrentdate & "# AND The6MEvalScoreF lag = 'N') OR " & _
"(The12MEvalDat e <= #" & dteCurrentdate & "# AND The12MEvalScore Flag = 'N'))"
Else
Me.RecordSource = "SELECT * FROM Main_EE_Info " & _
"WHERE EmpType LIKE '[" & strEmpType & "]*' " & _
"AND Terminated Like '" & strTerm & "' " & _
"AND ((The3MEvalDate <= #" & dteCurrentdate & "# AND The3MEvalScoreF lag = 'N') OR " & _
"(The6MEval Date <= #" & dteCurrentdate & "# AND The6MEvalScoreF lag = 'N') OR " & _
"(The12MEvalDat e <= #" & dteCurrentdate & "# AND The12MEvalScore Flag = 'N'))"
End If
'MsgBox "Me.RecordSourc e = " & Me.RecordSource
' MsgBox "Me.Date = " & FThe3MEvalDate
' MsgBox "Me.Date = " & dteCurrentdate
If The3MEvalDate <= dteCurrentdate Then
If The3MEvalScoreF lag = "N" Then
Me.FThe3MEvalDa te.BackColor = "RED"
End If
End If
If The6MEvalDate <= dteCurrentdate Then
If The6MEvalScoreF lag = "N" Then
Me.FThe6MEvalDa te.BackColor = "RED"
End If
End If
If The12MEvalDate <= dteCurrentdate Then
If The12MEvalScore Flag = "N" Then
Me.FThe12MEvalD ate.BackColor = "RED"
End If
End If
DoCmd.Close acForm, "SelectReportCr iteriaEval"
End Sub[/CODE]
Any help would be greatly appreciated... I am sure I ma just putting this in the wrong event or somethign but It is Friday and my head hurts so I am posting as a last resort!
THANK YOU!
I have a report where it lista employees that need to have an eval done in the next 30 days.
If the employee has a 3 month, 6 month or 12 month eval due in the next 30 days it lists the employee name, 3 month eval due date, 3 month eval score, 6 month eval due date, 6 month eval score, and 12 month eval due date and score. I would like the report to bold or highlight either the 3, 6 or 12 month eval due date that made teh ee hit the report criteria, and I cannot seem to get to to work ... So for each ee in the list one of the due dates would be in BOLD or have a red background... (Which i have tried in the ON Open event of the form.
here is my code...
[CODE=vb]Private Sub Report_Open(Can cel As Integer)
Dim strDivision As String
Dim strTerm As String
Dim strEmpType As String
Dim dteCurrentdate As Date
'Open the form to get the variables
DoCmd.OpenForm "SelectReportCr iteriaEval", acNorman, , , , acDialog
' Get the Seleceted Values
strDivision = Nz(Forms("Selec tReportCriteria Eval")!selDivis ion, " ")
strTerm = "N"
strEmpType = "Temp"
dteCurrentdate = DateAdd("m", 1, Date)
'MsgBox "strDivisio n = " & strDivision
' Set the recordsource for the report
If strDivision <> "ALL" Then
Me.RecordSource = "SELECT * FROM Main_EE_Info " & _
"WHERE Division = '" & strDivision & "' " & _
"AND EmpType LIKE '[" & strEmpType & "]*' " & _
"AND Terminated Like '" & strTerm & "' " & _
"AND ((The3MEvalDate <= #" & dteCurrentdate & "# AND The3MEvalScoreF lag = 'N') OR " & _
"(The6MEval Date <= #" & dteCurrentdate & "# AND The6MEvalScoreF lag = 'N') OR " & _
"(The12MEvalDat e <= #" & dteCurrentdate & "# AND The12MEvalScore Flag = 'N'))"
Else
Me.RecordSource = "SELECT * FROM Main_EE_Info " & _
"WHERE EmpType LIKE '[" & strEmpType & "]*' " & _
"AND Terminated Like '" & strTerm & "' " & _
"AND ((The3MEvalDate <= #" & dteCurrentdate & "# AND The3MEvalScoreF lag = 'N') OR " & _
"(The6MEval Date <= #" & dteCurrentdate & "# AND The6MEvalScoreF lag = 'N') OR " & _
"(The12MEvalDat e <= #" & dteCurrentdate & "# AND The12MEvalScore Flag = 'N'))"
End If
'MsgBox "Me.RecordSourc e = " & Me.RecordSource
' MsgBox "Me.Date = " & FThe3MEvalDate
' MsgBox "Me.Date = " & dteCurrentdate
If The3MEvalDate <= dteCurrentdate Then
If The3MEvalScoreF lag = "N" Then
Me.FThe3MEvalDa te.BackColor = "RED"
End If
End If
If The6MEvalDate <= dteCurrentdate Then
If The6MEvalScoreF lag = "N" Then
Me.FThe6MEvalDa te.BackColor = "RED"
End If
End If
If The12MEvalDate <= dteCurrentdate Then
If The12MEvalScore Flag = "N" Then
Me.FThe12MEvalD ate.BackColor = "RED"
End If
End If
DoCmd.Close acForm, "SelectReportCr iteriaEval"
End Sub[/CODE]
Any help would be greatly appreciated... I am sure I ma just putting this in the wrong event or somethign but It is Friday and my head hurts so I am posting as a last resort!
THANK YOU!
Comment