Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Function to Set Row Source Property

Status
Not open for further replies.

bajo71

Programmer
Aug 6, 2007
135
US
Hello,

I am attemping to use DatePart("YYYY",Now());DatePart("YYYY",Now())-1 etc to set the Row Source property of a List Box. Is there any way to write this function in designer or do I have to use a callback or some other functionality?

Thank you..........RO
 
For your edification...

Function ListYears(fld As Control, id As Variant, _
row As Variant, col As Variant, code As Variant) _
As Variant
Dim intOffset As Integer
Select Case code
Case acLBInitialize ' Initialize
ListYears = True
Case acLBOpen ' Open
ListYears = Timer ' Unique ID
Case acLBGetRowCount ' Get rows
ListYears = 2
Case acLBGetColumnCount ' Get columns
ListYears = 1
Case acLBGetColumnWidth ' Get column width
ListYears = -1 ' Use default width
Case acLBGetValue ' Get the data
ListYears = DatePart("YYYY", Now()) - 1 * row
End Select
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top