Results 1 to 6 of 6
  1. #1
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DatePicker_AfterUpdate How do you

    1) Anyone know how to get an after update event going for DatePicker?
    2) If there is a way, then how do I get the DatePicker's date to a query that the form is based on. Is it like 'Calendar' and needs to have a default set in the forms OnLoad event, cause you can't set the alue of DatePicker!
    Regards,
    Peter

  2. #2
    Silver Lounger
    Join Date
    Jan 2001
    Location
    Indianapolis, Indiana, USA
    Posts
    1,862
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DatePicker_AfterUpdate How do you

    Just curious - what's DatePicker? <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Patterson Lakes, Melbourne, Victoria, Australia
    Posts
    637
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DatePicker_AfterUpdate How do you

    Microsoft Date and Time Picker. Entry under 'Class' in the form's Properties dialog = 'MSComCtl2.DTPicker.2'. It's an ActiveX control included with Access (may only be with Developer, not certain). It's a drop down box that drops down a calendar. Pretty neat except I can't get an AfterUpdate event to work.
    Regards,
    Peter

  4. #4
    2 Star Lounger
    Join Date
    Dec 2000
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DatePicker_AfterUpdate How do you

    You can find a lot of what you're asking at Microsoft's MSDN web site.

    Check out <A target="_blank" HREF=http://msdn.microsoft.com/library/devprods/vs6/vbasic/cmctl298/vbctldatepickercontrol.htm>http://msdn.microsoft.com/library/devprods...ckercontrol.htm</A>

    Notice there is no After_Update event in the list:
    CallbackKeyDown Event
    CloseUp Event
    DragDrop Event
    DragOver Event
    DropDown Event (DateTimePicker Control)
    Format Event (DateTimePicker Control)
    FormatSize Event
    GotFocus Event
    LostFocus Event
    Validate Event

    FWIW
    TomG

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: DatePicker_AfterUpdate How do you

    DatePicker should work pretty much like the MonthView control, since it appears to be dropdown version of the latter. If you go into your form's code module and click on the name of the datepicker control in the left dropdown of the code pane, the right dropdown will show you the events for the control. There will probably be something equivalent to DateClick, so you might be able to use something like this, which I pulled from a form that uses MonthView:

    <pre>Private Sub oleCalendar_DateClick( _
    ByVal DateClicked As Date)
    'store the selected date
    Me!txtDtSelected = DateClicked
    End Sub 'oleCalendar_DateClick( _
    ByVal DateClicked As Date)</pre>


    Since it exposes a validate event, you should be able to use that like a BeforeUpdate event to validate the date value if you need to and cancel the update if necessary.
    Charlotte

  6. #6
    qais
    Guest

    Re: DatePicker_AfterUpdate How do you

    As stated earlier this control has no After Update event. Usually it is best to use the On Exit or On Lost Focus to fire off your code. There is a free sample for this control on my web page.

Posting Permissions

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