Weird problem with DatePicker

  • Thread starter Thread starter Bill Nguyen
  • Start date Start date
B

Bill Nguyen

Every time I jumped to a new month, the app kept popping up the message box
for subsequent months until 2050! If I stayed within the same month (current
month), it worked fine.
Please take a look at the following codes. Nothing special about it.
Please help!!

Bill

Private Sub dtPicker1_ValueChanged(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles dPicker1.ValueChanged

If dPicker1.Value >= Today Then

Beep()

MsgBox("Invalid Sales date: " & dPicker1.Value & vbCrLf & _

"Please choose a valid Sales date.")

Exit Sub

Else

Call DoLoadCombo()


End If



End Sub
 
Bill
Do you have more than one DateTimePicker?
I see your code has dtPicker1 and dPicker1?


---
Steve Stein -VB .NET Team
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
| From: "Bill Nguyen" <[email protected]>
| Subject: Weird problem with DatePicker
| Date: Mon, 3 May 2004 10:36:40 -0700
| Lines: 33
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.languages.vb
| NNTP-Posting-Host: 66-162-157-205.gen.twtelecom.net 66.162.157.205
| Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12
phx.gbl
| Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.languages.vb:200228
| X-Tomcat-NG: microsoft.public.dotnet.languages.vb
|
| Every time I jumped to a new month, the app kept popping up the message
box
| for subsequent months until 2050! If I stayed within the same month
(current
| month), it worked fine.
| Please take a look at the following codes. Nothing special about it.
| Please help!!
|
| Bill
|
| Private Sub dtPicker1_ValueChanged(ByVal sender As System.Object, ByVal e
As
| System.EventArgs) Handles dPicker1.ValueChanged
|
| If dPicker1.Value >= Today Then
|
| Beep()
|
| MsgBox("Invalid Sales date: " & dPicker1.Value & vbCrLf & _
|
| "Please choose a valid Sales date.")
|
| Exit Sub
|
| Else
|
| Call DoLoadCombo()
|
|
| End If
|
|
|
| End Sub
|
|
|
 
Steve;
Yes, but it's not the problem. There must be something else that caused the
looping. I had to set the maxdate value to the same month so that it won't
jump to subsequent months. This worked for me but I still cannot figure out
what wrong with the codes.
Thanks
Bill
 
Back
Top