Hi
I have a list box which is populated with fiscal year names from a view. When the form opens I want to select the appropriate entry in the listbox according to the current date. I run into problems when trying to read through the entries in the listbox, the following always gives me a lstyears.value of NULL so the loop always stops on the last listbox entry
For i = 1 To lstYears.ListCount
Me.lstYears.Selected(i) = True
If InStr(Me.lstYears.value, SearchYr) Then
GoTo FoundYr
End If
Next i
FoundYr:
e.g. There would be a line in the list box of 'Fiscal Year 2001' and I have already determined that SearchYr contains '2001' by matching today's date against my company's fiscal calendar table.
Whats up with it, Its really starting to wind me up???
I have a list box which is populated with fiscal year names from a view. When the form opens I want to select the appropriate entry in the listbox according to the current date. I run into problems when trying to read through the entries in the listbox, the following always gives me a lstyears.value of NULL so the loop always stops on the last listbox entry
For i = 1 To lstYears.ListCount
Me.lstYears.Selected(i) = True
If InStr(Me.lstYears.value, SearchYr) Then
GoTo FoundYr
End If
Next i
FoundYr:
e.g. There would be a line in the list box of 'Fiscal Year 2001' and I have already determined that SearchYr contains '2001' by matching today's date against my company's fiscal calendar table.
Whats up with it, Its really starting to wind me up???