L
Larry Salvucci
I have the following code behind a command button on my form. It works fine
in 2003 but for some reason it won't update the control "NextReviewDate" when
I use 2007. Can anyone shed some light on why it won't work in 2007?
If Forms!frmEmployeeMain!CurrentType = "Hourly" Then
If IsNull(Forms!frmEmployeeMain!RehireDate) Then
If IsNull(LastType) Then
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 1, Forms!frmEmployeeMain.StartDate), 1)
End If
'RecCount = ECount("Counter", "tblEmployeeReviews",
"EmployeeReviewID= " & Me.EmpID)
Select Case LastType
Case 1
'1 Month Review Complete. Calculate 2 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 2, Forms!frmEmployeeMain.StartDate), 1)
Case 2
'2 Month Review Complete. Calculate 3 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 3, Forms!frmEmployeeMain.StartDate), 1)
Case 3
'3 Month Review Complete. Calculate 6 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 6, Forms!frmEmployeeMain.StartDate), 1)
Case 4
'6 Month Review Complete. Calculate Annual Review Date from
Hire Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("yyyy", 1, Forms!frmEmployeeMain.StartDate), 1)
Case Else
'Annual Review Complete. Calculate Annual Review from Hire
Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("yyyy", [LastYear], Forms!frmEmployeeMain.StartDate),
1)
End Select
Else
If IsNull(LastType) Then
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 1, Forms!frmEmployeeMain.StartDate), 1)
End If
'RecCount = ECount("Counter", "tblEmployeeReviews",
"EmployeeReviewID= " & Me.EmpID)
Select Case LastType
Case 1
'1 Month Review Complete. Calculate 2 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 2, Forms!frmEmployeeMain.RehireDate), 1)
Case 2
'2 Month Review Complete. Calculate 3 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 3, Forms!frmEmployeeMain.RehireDate), 1)
Case 3
'3 Month Review Complete. Calculate 6 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 6, Forms!frmEmployeeMain.RehireDate), 1)
Case 4
'6 Month Review Complete. Calculate Annual Review Date from
Hire Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("yyyy", 1, Forms!frmEmployeeMain.RehireDate), 1)
Case Else
'Annual Review Complete. Calculate Annual Review from Hire
Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("yyyy", [LastYearRH],
Forms!frmEmployeeMain.RehireDate), 1)
End Select
End If
Else
End If
in 2003 but for some reason it won't update the control "NextReviewDate" when
I use 2007. Can anyone shed some light on why it won't work in 2007?
If Forms!frmEmployeeMain!CurrentType = "Hourly" Then
If IsNull(Forms!frmEmployeeMain!RehireDate) Then
If IsNull(LastType) Then
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 1, Forms!frmEmployeeMain.StartDate), 1)
End If
'RecCount = ECount("Counter", "tblEmployeeReviews",
"EmployeeReviewID= " & Me.EmpID)
Select Case LastType
Case 1
'1 Month Review Complete. Calculate 2 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 2, Forms!frmEmployeeMain.StartDate), 1)
Case 2
'2 Month Review Complete. Calculate 3 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 3, Forms!frmEmployeeMain.StartDate), 1)
Case 3
'3 Month Review Complete. Calculate 6 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 6, Forms!frmEmployeeMain.StartDate), 1)
Case 4
'6 Month Review Complete. Calculate Annual Review Date from
Hire Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("yyyy", 1, Forms!frmEmployeeMain.StartDate), 1)
Case Else
'Annual Review Complete. Calculate Annual Review from Hire
Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("yyyy", [LastYear], Forms!frmEmployeeMain.StartDate),
1)
End Select
Else
If IsNull(LastType) Then
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 1, Forms!frmEmployeeMain.StartDate), 1)
End If
'RecCount = ECount("Counter", "tblEmployeeReviews",
"EmployeeReviewID= " & Me.EmpID)
Select Case LastType
Case 1
'1 Month Review Complete. Calculate 2 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 2, Forms!frmEmployeeMain.RehireDate), 1)
Case 2
'2 Month Review Complete. Calculate 3 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 3, Forms!frmEmployeeMain.RehireDate), 1)
Case 3
'3 Month Review Complete. Calculate 6 Month Review Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("m", 6, Forms!frmEmployeeMain.RehireDate), 1)
Case 4
'6 Month Review Complete. Calculate Annual Review Date from
Hire Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("yyyy", 1, Forms!frmEmployeeMain.RehireDate), 1)
Case Else
'Annual Review Complete. Calculate Annual Review from Hire
Date
Forms!frmEmployeeMain.NextReviewDate =
GetBusinessDay(DateAdd("yyyy", [LastYearRH],
Forms!frmEmployeeMain.RehireDate), 1)
End Select
End If
Else
End If