Results 1 to 3 of 3

Thread: Add item to current date

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    How would I get the below code to go from 1994 to the current date. I tried to use Date but I get an overflow error message?


    Private Sub Form_Load()
    Dim i As Integer
    For i = 1 To 12
    cboMonth.AddItem Format(i & "/" & i, "mmmm")
    Next i

    For i = 0 To 10
    cboYear.AddItem 1994 + i
    Next i


    End Sub

  2. #2
    Guest
    Code:
    Private Sub Form_Load()
    
          Dim intCount As Integer
          
          For intCount = 1994 To Year(Now)
                cboYear.AddItem intCount
          Next
    
    End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2000
    Location
    bebenia, PA, USA
    Posts
    241
    thanks worked like a charm!!!

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