Connie-
Let's say the name of your List Box control is lstYears. Make the Row Source a
Value List, set the Bound Column to 1, and set the Multi Select property to
either Simple or Extended. In the Load event of the form, do this:
Dim intYear As Integer
intYear = 2004
Do Until intYear > Year(Date)
Me.lstYears.AddItem intYear
intYear = intYear + 1
Loop
John Viescas, author
Microsoft Office Access 2010 Inside Out
Microsoft Office Access 2007 Inside Out
Building Microsoft Access Applications
Microsoft Office Access 2003 Inside Out
SQL Queries for Mere Mortals
http://www.viescas.com/
(Waco, Texas <yee haw>)
-----Original Message-----
From: MS_Access_Professionals@yahoogroups.com
[mailto:MS_Access_Professionals@yahoogroups.com] On Behalf Of mrsgoudge
Sent: Wednesday, December 21, 2011 1:32 PM
To: MS_Access_Professionals@yahoogroups.com
Subject: [MS_AccessPros] Populating multi-select box with years 2004, 2005, etc
through current year
I have a filter by form with the filter being created in the header. I would
like to filter on the years using a multi-select box that has years 2004 through
the current year. So if it was made now, it would only go to 2011 and then when
we hit the new year 2001 would be added.
Is there a way to do this?
Thanks!
Connie
------------------------------------
Yahoo! Groups Links
Rabu, 21 Desember 2011
RE: [MS_AccessPros] Populating multi-select box with years 2004, 2005, etc through current year
__._,_.___
MARKETPLACE
.
__,_._,___
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar