Results 1 to 8 of 8

Thread: DateTime Picker - Can't figure this out. [RESOLVED]

Threaded View

  1. #1

    Thread Starter
    Fanatic Member The_Grudge's Avatar
    Join Date
    Jan 2005
    Location
    Canada
    Posts
    836

    Resolved DateTime Picker - Can't figure this out. [RESOLVED]

    I have a DateTime picker on my form that allows the user to select an "End Date" for how long a record should be written to the database. After having a tester run my program yesterday I was told I should not allow the user to enter an "End Date" that was earlier than the "Start Date". Makes sense.

    So this morning I have coded the following.
    The MsgBox displays when it should, and the date on the dtPicker changes to today's date, BUT the calander of the dtPicker is still open displaying the original date the user picked. How do I close the calendar part?
    I thought the "REFRESH" statement would do it...but nope.
    Or is there a better way to do this alltogether??


    VB Code:
    1. Private Sub dtEndDate_Change()
    2. If dtEndDate.Value < MonthViewClinic.Value Then
    3.    MsgBox "You cannot select an end date that occurs before the start date", vbInformation, "Invalid Selection"
    4.    dtEndDate.Value = MonthViewClinic.Value
    5.    
    6.    dtEndDate.Year = Year(Now)
    7.    dtEndDate.Month = Month(Now)
    8.    dtEndDate.Day = Day(Now)
    9.    dtEndDate.Refresh
    10.    Exit Sub
    11. End If
    12. End Sub
    Last edited by The_Grudge; Jun 3rd, 2005 at 12:20 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width