[AccessD] Manually populate a listbox

Stuart McLachlan stuart at lexacorp.com.pg
Sun Aug 15 16:21:28 CDT 2004


On 15 Aug 2004 at 13:21, Arthur Fuller wrote:

> 
> I want to manufacture all dates between the start and end date and
> populate the listbox with same. I forget how to do it. I'm used to
> grabbing data using SQL etc. and I suppose I could just build a table
> containing loads of dates and query that, but I'm wondering how to
> manufacture the listbox rows instead.
> 
> 

Here's one way:
Private Function FillList(StartDate As Date, EndDate As Date) As Long
	Dim dteLoop As Date
	Dim strListSource As String
	For dteLoop = StartDate To EndDate
		strListSource = strListSource & ";" & dteLoop
	Next
	strListSource = Mid$(strListSource, 2)
	lstDates.RowSource = strListSource
End Function-- 
Stuart





More information about the AccessD mailing list