Results 1 to 13 of 13
  1. #1
    Join Date
    Apr 2003
    Posts
    59

    Unanswered: Combobox formatting

    When a combobox is opened the selected value is always at the top, with the following values dropping down below it. In my form the user is selecting a date, and he's just as likely to want to select yesterday as tomorrow. So I would like the box to open so that the selected value is in the middle of the list, so a few days before and a few days after are all displayed without the user having to scroll.

    Does that make sense, and can I do it?

    Thanks xx


    Forgot to say, I'm using Access 97
    Last edited by katerpillar; 06-06-07 at 08:28.

  2. #2
    Join Date
    Feb 2007
    Posts
    348
    I'm taking a shot withouth actually trying this.

    You would want to have two columns (or more) to your combo box. The first one would be the order (1,2,3...) the second would be your dates or even the words (yesterday, today, tomorrow). Order by column 1, but give it a width of 0 so it doesn't display. Make sure you index column two (or three depending on if you are literally pasing the value in the box).

  3. #3
    Join Date
    Aug 2006
    Posts
    559
    What is the reason for the dates? if they select a date, why not just open a calendar form and let them select the date then have it insert the date into a text box?

  4. #4
    Join Date
    Apr 2003
    Posts
    59
    errr... because I have no idea how to make a calendar form?

    The form is a timesheet, there's a day combobox, month combobox and year text box. The days are filtered to allow only weekdays, and there's a <show all> option in the day and month, and the year can be left blank, in order to be able to select a whole month, a whole year, or the 7th of every month, and so on. A subform of timesheet entries is displayed dependent on the entered (or not entered) date. Can a calendar do this?

  5. #5
    Join Date
    Aug 2006
    Posts
    559
    Making a calendar form is easy.

    Steps:

    Create new form, say "frmCalendar".
    Then go to "Insert" , "ActiveX Controls" , then you'll see a option for "Calendar Control 11.0".

    You'll then see the calendar show up in the form.

    Or...

    You can check out the zips on this post. There are a couple of different ones you can import into your database or just use, like print out the code for the entire project and it'll give you an idea on what you may have to code or do. if you don't want to do that, then just look through the properties on each object on each form and you'll get an idea.

    Or...

    in the 'MS Access CodeBank' on the main page within the MS Access portion of this form, where all the MS Access individual posts are listed.

    And...

    I have another one that I am using on the database I'm currently working on but I have to find out where that one is.
    Attached Files Attached Files

  6. #6
    Join Date
    Aug 2006
    Posts
    559
    Oh, the other one. Yeah, PKSTORMY, put it in the Code Bank.

    It's on the second page of the code bank, about 1/3 of the way down called "Calendar Example" it uses the Call PopUp function. That's the way I'm doing it in mine currently.

  7. #7
    Join Date
    Feb 2007
    Posts
    348
    thanks for that, I'll be stealing this as well
    :-)

  8. #8
    Join Date
    Aug 2006
    Posts
    559
    Quote Originally Posted by starkmann
    thanks for that, I'll be stealing this as well
    :-)
    "Stealing is Sharing... Or is it... Sharing is Stealing"

  9. #9
    Join Date
    Apr 2003
    Posts
    59
    Thanks but I can't open any of those. I did mention Access 97 didn't I?

    Can anyone answer the original question? ;-)

  10. #10
    Join Date
    Aug 2006
    Posts
    559
    Quote Originally Posted by katerpillar
    Thanks but I can't open any of those. I did mention Access 97 didn't I?

    Can anyone answer the original question? ;-)
    Katerpillar,

    Try these, they are in Access 97, some of them.
    Attached Files Attached Files

  11. #11
    Join Date
    Feb 2007
    Posts
    348
    Quote Originally Posted by katerpillar
    Thanks but I can't open any of those. I did mention Access 97 didn't I?

    Can anyone answer the original question? ;-)
    I thought I did, waaaay up top.

  12. #12
    Join Date
    Apr 2003
    Posts
    59
    Quote Originally Posted by starkmann
    I thought I did, waaaay up top.
    Oh yes. I think I unconsciously bypassed it because I didn't understand! Currently the box has one column, the values go something like 1;4;5;6;7;8;11 etc (that's for June, weekends missing). How will putting another column in help?

  13. #13
    Join Date
    Feb 2007
    Posts
    348
    oooh, you're using hand keyed values....erm. In that case, my approach won't help.

    There are a variety of ways to do this, I'm trying to think of what works best for this timesheet app. If you are just literally passing the day number...
    do this =Str$(Day(Date())) for your default value. Fair warning though, if you go into the DB on a day that isn't on your list, I can't say what it will do.

Posting Permissions

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