increment along a group of variables

  • Thread starter Thread starter Dickie Black
  • Start date Start date
D

Dickie Black

Hi,

I want to use a Dlookup to find records from a specific day, at a number of
times during that day. I know i will have to use a separate Dlookup for
each value i want to return, so I was going to use a for...next statement.
However, the times are non-sequential (eg 09:30, 11:15, 12:20 etc). I can
store these time values in a group of variables (var1, var2, var3 etc), but
how can I use some form of increment (eg var & i) to specify which one to
use, or is some other method necessary?

Example code:

For i =1 to 5

me("textbox" & i).caption = Dlookup("[Title]", rs, "[StartTime] = var & i")

(where rs is the recordset previously defined, incorporating a date value)

TIA

Dickie Black
 
Back
Top