Select Current Month

frankbutcher

Registered User.
Local time
Today, 11:00
Joined
Aug 6, 2004
Messages
192
Hi
Hope someone can help.
I have a combo box box in a form, which selects the month and year..January 2009, February 2009, in this format. The info for the combo box comes from a table, and starts at January 2007.
So when I select the combo, I have to scroll down, starting at January 2007.
Is there anyway for the combo box to start at the current month instead?

Many thanks.

Frank.
 
Can you not base it on a query on the table with suitable criteria?

Brian
 
Thanks for the reply.
It is based on a query...sorry, should have mentioned that.

What would I have to put in the query?

Many thanks.

Frank.
 
Select Period From Table Where Period => Format(Date(),"mmmm yyyy")

if the period is derived from a specific date in your table, firstly there is no need to store this as it can be determined by a query, if you group by Period:Format(YourDate,"mmmm yyyy")

David
 
I think this does what you need. When you move to the combobox it'll drop down and the current month/year will be selected:

Code:
Private Sub MonthYearCombo_GotFocus()
 MonthYearCombo.Dropdown
 Me.MonthYearCombo = Format(Date, "mmmm yyyy")
End Sub
 

Users who are viewing this thread

Back
Top Bottom