I am an extreme novice @ coding - I need help with the following...
I have a text box on a form called detailed effective date - I want to update two other fields based on this field - I put the following code in the after update event of the detailed effective date field
Dim dtDetEffDate As Date
dtDetEffDate = [Detailed Effective Date]
If dtDetEffDate >= "1/1/2002" And dtDetEffDate<= "1/31/2002" Then
[Effective Date] = "January"
ElseIf dtDetEffDate >= "2/1/2002" And dteDetEffDate <= "2/31/2002" Then
[Effective Date] = "February"
ElseIf dtDetEffDate >= "3/1/2002" And dteDetEffDate <= "3/31/2002" Then
[Effective Date] = "March"
Else: MsgBox ("You entered an invalid date"
End If
End Sub
THis works for 1/1 through 2/29 but for march groups it is putting in a "february" result.
Any idea what I am doing wrong???
Thanks for all of your help.
I have a text box on a form called detailed effective date - I want to update two other fields based on this field - I put the following code in the after update event of the detailed effective date field
Dim dtDetEffDate As Date
dtDetEffDate = [Detailed Effective Date]
If dtDetEffDate >= "1/1/2002" And dtDetEffDate<= "1/31/2002" Then
[Effective Date] = "January"
ElseIf dtDetEffDate >= "2/1/2002" And dteDetEffDate <= "2/31/2002" Then
[Effective Date] = "February"
ElseIf dtDetEffDate >= "3/1/2002" And dteDetEffDate <= "3/31/2002" Then
[Effective Date] = "March"
Else: MsgBox ("You entered an invalid date"
End If
End Sub
THis works for 1/1 through 2/29 but for march groups it is putting in a "february" result.
Any idea what I am doing wrong???
Thanks for all of your help.