Results 1 to 3 of 3

Thread: Entering Dates in Combo Boxes (2) ??

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2000
    Posts
    9
    Hello,

    First of all thanks to "bsmith" for getting me started. I have now got the dates reading into the combo box, but after each date in the list appear two characters that look like two bold |'s, (ie) 01 Jan II etc...

    Is there any way I can get rid of these, to be able to just show the dates (ie) 01 Jan
    Below is the code I am using and also my original problem:

    Hope someone can help...
    Thanks,
    Andy............
    Code:
    Private Function PopulateDates(strForYear As String)
    
        Dim dtStartDate As Date
        Dim dtCurrentDate As Date
        Dim strForYear2
        
        dtStartDate = CDate("01/01/" & strForYear)
        dtCurrentDate = dtStartDate
        Do While strForYear = Format(dtCurrentDate, "yyyy")
            Combo1.AddItem strForYear2 & Format(dtCurrentDate, "dd mmm ") & vbCrLf
            dtCurrentDate = dtCurrentDate + 1
        Loop
    End Function
    
    Private Sub Command1_Click()
    
        PopulateDates (2000)
    
    End Sub
    Original Problem...
    Is there any possible way that you can use an array or something like it to fill a list box with all the possible dates of the year, with just the date and month and not the year????

    (ie) having it automatically display 1st January til 31st December...without the year being shown...????

    Hope someone can help...
    Thanks,
    Andy............

  2. #2
    New Member
    Join Date
    Mar 2000
    Posts
    8
    remove the "& vbCrLf" from the additem statement

    I think

    -Jamie One-

  3. #3
    New Member
    Join Date
    Mar 2000
    Posts
    8
    Also you don't need the variable "strForYear2"

    -Jamie One-

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