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.
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).
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?
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.
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.
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.
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.
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?
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.