Hi. I have a form where there is an unbound combo for the user to select a week (i..e week 1 to 52). Instead of filling all these numbers in manually, is there a way to use a function to create the values?
eg in my case it would be Datepart("ww", Date()) + 1 to get the next value. and then just select some limits.
Is this possible? I know in this case it's easy to just write out all the numbers but I need it for something more complicated.
Option Compare Database
Private Sub Form_Open(Cancel As Integer)
Me.Combo0.RowSource = MyList(1, 10)
Public Function MyList(Lower As Integer, Upper As Integer) As String
Dim i As Integer
MyList = Lower
For i = Lower + 1 To Upper
MyList = MyList & "; " & CStr(i)