R
Ron
thanks for all the help everyone. Ok so there are exception years and
I am trying to write this code in for the exception years, anyone see
what i am doing wrong:
easter = (22 + d + g)
easterinapril = (easter - 31)
easterspecialyear = (easter - 7)
'for years 1954, 1981...etc. use this (easter-7) or (22+d+g)-(7))
'the below does not work, do i need it somewhere else in my if
statements to make this work correctly?
If CInt(txtYear.Text) = 1954 Or CInt(txtYear.Text) = 1981 Or
CInt(txtYear.Text) = 2049 Or CInt(txtYear.Text) = 2076 Then
lblResult.Text = easterspecialyear
Else
If CInt(txtYear.Text) < 1901 Or CInt(txtYear.Text) > 2099
Then
lblResult.Text = "Please enter a valid year"
ElseIf easter > 31 Then
lblResult.Text = "Easter in the year " & txtYear.Text &
" " & "is on April " & easterinapril
Else
lblResult.Text = "Easter in the year " & txtYear.Text &
" " & "is on March " & easter
End If
End If
End Sub
I am trying to write this code in for the exception years, anyone see
what i am doing wrong:
easter = (22 + d + g)
easterinapril = (easter - 31)
easterspecialyear = (easter - 7)
'for years 1954, 1981...etc. use this (easter-7) or (22+d+g)-(7))
'the below does not work, do i need it somewhere else in my if
statements to make this work correctly?
If CInt(txtYear.Text) = 1954 Or CInt(txtYear.Text) = 1981 Or
CInt(txtYear.Text) = 2049 Or CInt(txtYear.Text) = 2076 Then
lblResult.Text = easterspecialyear
Else
If CInt(txtYear.Text) < 1901 Or CInt(txtYear.Text) > 2099
Then
lblResult.Text = "Please enter a valid year"
ElseIf easter > 31 Then
lblResult.Text = "Easter in the year " & txtYear.Text &
" " & "is on April " & easterinapril
Else
lblResult.Text = "Easter in the year " & txtYear.Text &
" " & "is on March " & easter
End If
End If
End Sub