Results 1 to 5 of 5

Thread: A Nice One

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Red face

    I have two listboxes - Start Date & End Date, I want to populate these listboxes with dates ranging from today(system date) up to today, next year ie all dates from 08/08/2000 thru 08/08/2001.

    Must I just get the system date and in a loop add 1 to the day, check month, check year and add each loop to the listboxes or is there an easier way!!??

  2. #2
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    1) Use a datepicker control instead of the list box

    2) dtpStart.value= date will set the first one to the current date.
    3) dtpEnd.value = DateAdd("y", 1, Date) will set the end value.

    You'll just need to make sure, in code that they dont select beyond the two dates...

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Cool

    First time I've used the datepicker - VERY NICE!!!

    The only problem I'm having now is binding the datepicker to my table... here's my code..

    Set DTPickerStart.DataSource = rsRecord
    DTPickerStart.DataField = "start_date"

    It's a MS ACCESS database and start_date is set to Date/Time. This worked fine when I was using the listbox. I also set start_date to text in the database, but I still get the error....
    "runtime 545 - Unable to bind to field or datamember: start_date"

    Must one do something "special" when binding the datepicker!!??


  4. #4
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    If you have to bind the control, set it on the control itself (click on databindings).

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2000
    Posts
    343

    Angry

    No luck - still get the same error!!

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