I have a recordset that has a number of fields including days from 28 to 31 ...
I want to put the data in a ListView control but how do I loop through the changing number of days???
Here's what I got so far:
The rs!z in the For/Next loop should be replaced with number from 1 to (28/.../31) e.g. lstItem.SubItems(z) = rs!1 holds the value for day 1 and so on ...
I want to put the data in a ListView control but how do I loop through the changing number of days???
Here's what I got so far:
Code:
rs.MoveFirst
Do Until rs.EOF
Set lstItem = Form_frmvagter.MainList.ListItems.Add()
lstItem.Text = rs!Navn
lstItem.SubItems(1) = rs!Afd
For z = 1 To intNoOfDays
lstItem.SubItems(z) = rs!z 'Here comes trouble: rs!z
Next
rs.MoveNext 'next row
Loop
The rs!z in the For/Next loop should be replaced with number from 1 to (28/.../31) e.g. lstItem.SubItems(z) = rs!1 holds the value for day 1 and so on ...