I searched the foruma and was unable tofind an answer to my problem. When i tryto cahnge themonth of theDatetimepicker it fires the valuechanged code below, then gets stuck in a loop for the valuechanged and keeps bringing up my messagebox. Is there a way to test if only the arrows at thetop are pressed and ignore if that is true?
To go where no programmer has gone before.
Code:
Private Sub dtBegin_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtBegin.ValueChanged
Dim Intdayofweek As Integer
Intdayofweek = DatePart(DateInterval.Weekday, dtBegin.Value)
If Intdayofweek = 1 Then
cmdReport.Visible = True
Else
MessageBox.Show("You must pick a Sunday for the report to run. Please try again", "Date Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End If
End Sub
To go where no programmer has gone before.