Results 1 to 4 of 4
  1. #1
    Join Date
    May 2004
    Posts
    55

    Unanswered: Does anybody know how to create a dropdown list for date and time?

    I need to create a drop down list to select date and time. Need HElp!!!!

    DH

  2. #2
    Join Date
    Dec 2003
    Posts
    268

    DateAdd

    Check out the date add function.

    Here is an example for a listbox to add 15 min incriments 16 times
    Private Sub loadDates()
    Dim source As String
    Dim tme As Date
    Dim i, j As Integer

    tme = Format(#1/1/2004 12:00:00 PM#, "mm/dd/yyyy hh:nn")
    source = tme

    For i = 0 To 15
    tme = DateAdd("n", 15, tme)
    source = source & ";" & tme
    Next i

    Me.List0.RowSource = source
    End Sub
    **************************************

    you can play with this to get the dates added that you want

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Post

    PHP Code:
      dim i as byte
        
    For 1 To 30
          yourComboBox
    .RowSource yourComboBox.RowSource 
             
    ";" DateSerial (year(date), month(date), i)
        
    Next 
    This will fill your yourComboBox with date values from 1 to 30 of the current month of the current year.

  4. #4
    Join Date
    May 2004
    Posts
    55
    Quote Originally Posted by mjweyland
    Check out the date add function.

    Here is an example for a listbox to add 15 min incriments 16 times
    Private Sub loadDates()
    Dim source As String
    Dim tme As Date
    Dim i, j As Integer

    tme = Format(#1/1/2004 12:00:00 PM#, "mm/dd/yyyy hh:nn")
    source = tme

    For i = 0 To 15
    tme = DateAdd("n", 15, tme)
    source = source & ";" & tme
    Next i

    Me.List0.RowSource = source
    End Sub
    **************************************

    you can play with this to get the dates added that you want

    What would the control source for my List box be?? How do I use this function for my listbox?
    Thanks,
    DH

Posting Permissions

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