Results 1 to 8 of 8
  1. #1
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    Toronto, Canada
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calendar Controls (2000 and or XP)

    I would like to have a drop down menu that will automatically give me a calendar, once clicked on the drop down arrow. Much like you see when you try to book a flight on an airline webpage. I know there is a control for calendar and I know how to create a combo box but how does one put two and two together. [img]/forums/images/smilies/smile.gif[/img]

    Anything would help?

  2. #2
    Gold Lounger
    Join Date
    Jun 2001
    Location
    Crystal Beach, FL, Florida, USA
    Posts
    3,436
    Thanks
    1
    Thanked 34 Times in 34 Posts

    Re: Calendar Controls (2000 and or XP)

    I don't understand the merging of the calendar control with the calendar. Hitting the down arrow on a combo box generally drops the listbox so you can see all the choices. How does the calendar fit into this? Why not just use a command button to launch the calendar?
    Mark Liquorman
    See my website for Tips & Downloads and for my Liquorman Utilities.

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

    Re: Calendar Controls (2000 and or XP)

    The control you're looking for is the Microsoft Date and Time Picker control, which is already built with the combobox functionality.
    Charlotte

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calendar Controls (2000 and or XP)

    But the Date and Time picker only comes with Visual Studio or Office Developer Edition. It is not part of a standard Access installation.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calendar Controls (2000 and or XP)

    You can simulate a dropdown calendar with the Calendar control that comes with Access. See the attached database. The form contains a combo box cboDate and a calendar control calCalendar. The code behind the form uses a module-level variable ctlCaller; this makes it possible to use multiple combo boxes with the same calendar control.

    Private ctlCaller As ComboBox

    Private Sub Calendar_Click()
    ctlCaller.Value = Calendar.Value
    ctlCaller.SetFocus
    Calendar.Visible = False
    Set ctlCaller = Nothing
    End Sub

    Private Sub cboDate_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Set ctlCaller = cboDate
    With Calendar
    .Left = Me.cboDate.Left
    .Top = Me.cboDate.Top + Me.cboDate.Height
    .Visible = True
    .SetFocus
    If Not IsNull(ctlCaller) Then
    .Value = ctlCaller.Value
    Else
    .Value = Date
    End If
    End With
    End Sub

    Note: the demo is based on the database attached to <post#=439005>post 439005</post#>.

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

    Re: Calendar Controls (2000 and or XP)

    True, but as I recall, none of the ActiveX controls are part of the standard installation.
    Charlotte

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Calendar Controls (2000 and or XP)

    The Calendar control (mscal.ocx) comes with Office Pro (which includes Access), but not with Office Standard (which does not include Access).

  8. #8
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    Toronto, Canada
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calendar Controls (2000 and or XP)

    WOW!
    Thanks for putting so much thought into this! Hans this is exactly what I am looking for.

    Thanks Again ALL!

Posting Permissions

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