Access 2010 How to change default starting point in a drop down box

Hi. In Access 2010 I have some reports that are sorted by month. I would like to be able to change the starting point each month when I click the drop down box so I don't have to scroll from 2002 to the current year to find the month. It's not a huge deal, but it would be nice if I didn't have to do that extra step. Where would I go to adjust this setting. Also, it is important that the previous months be viewable so I could scroll back if I needed to do so. I hope this makes sense. Thank you.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Rey Obrero (Capricorn1)Commented:
what is the rowsource of the combobox? post it here

you can use this codes in the enter event of the combo box


off course that will vary depending on the rowsource of your combo box
ryanrh24Author Commented:
I have attached a screen shot of the Row Source I believe.
Rey Obrero (Capricorn1)Commented:
need to see sample values.. better if you upload a copy of the db eith the form and relevant table and queries.
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

ryanrh24Author Commented:
I'm not sure what you mean. Upload the entire database file?
Rey Obrero (Capricorn1)Commented:
yes, just remove sensitive info
ryanrh24Author Commented:
Okay this should be it. Under the reports section is where I access it the most.
Rey Obrero (Capricorn1)Commented:
ok. what is the name of the form and the name of the combo box?
ryanrh24Author Commented:
Form - frmFuelInvoiceReport
combo box - rdatepull

Also, this combo box is used in multiple forms for pulling all the different report types.
Rey Obrero (Capricorn1)Commented:
place this codes in the enter event of the combo box

Private Sub rdatepull_Enter()
Dim iYear As Integer, iMonth As Integer
iYear = Year(Date): iMonth = Month(Date)
Me.rdatepull.Value = DLookup("iddate", "QRY_datepull", "mmonth=" & iMonth & " and myear=" & iYear)
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ryanrh24Author Commented:
That is great! Will I need to change this each month or is it set to automatically do that?
Rey Obrero (Capricorn1)Commented:
<Will I need to change this each month> NO
 or is it set to automatically do that? YES
ryanrh24Author Commented:
How would you change the code so it would show one month previous to the current month every time?
Rey Obrero (Capricorn1)Commented:
change this

 iMonth = Month(Date)


 iMonth = Month(Date) -1
ryanrh24Author Commented:
Thank you! I am receiving a new error. I have attached screen shots.
The main issue is whenever I use the Enter key to select the date from the rdatepull (Month) drop down box, it won't process the same way as when I click the date with my mouse, thus making the report unable to load. Is there a piece of code I can place in there to correct this?
ryanrh24Author Commented:
I still haven't been able to figure this out. I cannot make tabbing over and hitting enter do the same thing as clicking on the date with the mouse. It may have something to do with this macro I attached. Any help would be much appreciated! The first attachment is after the rdatepull code was added. The second is before, when the enter button worked.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.