Marshall,
Actually I could have an infinite number of records, so your approach won't
work for me. I really just need to know how, after opening a recordset I
can write the contents to the detail area of a report.
Tony
"Marshall Barton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Tony Piperato wrote:
>
> >Greetings,
> >
> >I am opening a recordset and would like to print the results in a report
> >detail section. I have the following code:
> >
> > Do Until rsMyRS.EOF
> > txtDateStart = rsMyRS("DateStart")
> > txtDateStop = rsMyRS("DateStop")
> > Debug.Print rsMyRS("DateStart") & " " & rsMyRS("DateStop")
> > rsMyRS.MoveNext
> > Loop
> >
> >txtDateStart and Stop are text boxes in the report detail section. There
> >are nine records in the RS, but I only get the first records' values
printed
> >nine times instead of EACH individual record.
>
>
> You only have a single txtDateStart text box in the detail
> section so it can only display a single value. You didn't
> explain enough about your report for me to tell what might
> be best for your situation, but here's a couple of ideas you
> might try.
>
> Place 9 txtDateStart and txtDateStop text boxes in the
> detail section. Name them txtDateStart1 through
> txtDateStart9, etc, then use code along these lines:
>
> intK = 0
> With rsMyRS
> Do Until .EOF
> intK = intK + 1
> Me("txtDateStart" & intK) = !DateStart
> Me("txtDateStop" & intK)= !DateStop
> Debug.Print !DateStart & " " &!DateStop
> rsMyRS.MoveNext
> Loop
>
> Actually, I think this whole approach is probably the wrong
> way around and you should use a subreport instead.
> --
> Marsh
> MVP [MS Access]
|