mckenneyj
MIS
- Jun 1, 2002
- 96
Can anyone tell me what is wrong with this statement.
If I comment out the IF stmt then the case works fine.
Private Sub Date_AfterUpdate()
Dim ResultYear As Integer
ResultYear = DatePart("yyyy", Me.Date)
If Me.cmbCycle = Null Then
Select Case ResultYear
Case 2003 To 2005:
Me.cmbCycle = "2003-2005"
Case 2006 To 2008:
Me.cmbCycle = "2006-2008"
Case 2009 To 2011:
Me.cmbCycle = "2009-2011"
Case 2012 To 2014:
Me.cmbCycle = "2012-2014"
Case 2015 To 2017:
Me.cmbCycle = "2015-2017"
Case 2018 To 2020:
Me.cmbCycle = "2018-2020"
End Select
End If
End Sub
Thanks,
John McKenney
Work Hard... Play Harder
If I comment out the IF stmt then the case works fine.
Private Sub Date_AfterUpdate()
Dim ResultYear As Integer
ResultYear = DatePart("yyyy", Me.Date)
If Me.cmbCycle = Null Then
Select Case ResultYear
Case 2003 To 2005:
Me.cmbCycle = "2003-2005"
Case 2006 To 2008:
Me.cmbCycle = "2006-2008"
Case 2009 To 2011:
Me.cmbCycle = "2009-2011"
Case 2012 To 2014:
Me.cmbCycle = "2012-2014"
Case 2015 To 2017:
Me.cmbCycle = "2015-2017"
Case 2018 To 2020:
Me.cmbCycle = "2018-2020"
End Select
End If
End Sub
Thanks,
John McKenney
Work Hard... Play Harder