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

    Unanswered: using dates in a combo box HELP!!!!!

    Hi
    Im trying to set up a combo box that has a list of dates that are 7 days before the current date and 21 days after the current date.
    i.e.25/05/04
    26/05/04
    going up to
    20/06/04
    21/06/04.

    Thanks very much
    Chris

  2. #2
    Join Date
    Apr 2003
    Location
    Alabama, USA
    Posts
    154
    Chris,

    Try this (Attachment is Access 2000 Version). cboDate is the name of the combobox.

    Code:
    Dim TheDateToday As Date
    
    TheDateToday = Date() - 7
    
    cboRowSource = TheDateToday & ";"
    
    For i = 1 To 28
    
    TheDateToday = TheDateToday + 1
    
    cboRowSource = cboRowSource & TheDateToday & ";"
    
    Next i
    
    Me.cboDate.RowSource = cboRowSource
    Attached Files Attached Files
    Last edited by Cosmos75; 06-01-04 at 05:33.
    http://AccessDB.Info

    You live and learn. At any rate, you live. - Douglas Adams

  3. #3
    Join Date
    May 2004
    Posts
    3

    Thanks

    Hi thanks for that, absolute life saver.
    Chris

  4. #4
    Join Date
    Apr 2003
    Location
    Alabama, USA
    Posts
    154
    Chris,

    You're welcome. Glad I could help.


    The sample is set to run the code on the OnOpen event of the form which I hope will work for your purposes.
    http://AccessDB.Info

    You live and learn. At any rate, you live. - Douglas Adams

Posting Permissions

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