Did I? I guess I wasn't very clear. I don't want to loop through the pages, I want to be able to access the pages from a loop.
But you figured out what I wanted, anyway. :) That code should be just what I need.
Thanks,
-Michelle
>You said "I then want to loop through all the pages" and this is what I gave you: two kinds of loop through all pages. :)
>
>Now, the "if" on the caption of the page was just a sample of syntax. Obviously, you can replace the "with This" with "ThisForm.tsPageFrame1", which is your actual pageframe object. But you're saying this is not what you want. :)
>
>I'm not sure what you want, but maybe this helps you:
>
scan for trips.igroup = thisform.group
> lcPage = "tsForm1.tsPageFrame1.page" + ltrim(str(i))
> with lcPage
> .caption = trips.cname
> .RecordNo = recno()
> endwith
>endscan
>
>Vlad
>
>>Hmmm... That's kind of the reverse of what I need. I don't want to go through the pages and assign them to records; I want to go through the records and assign them to pages.
>>
>>Like this:
>>
>>scan for trips.igroup = thisform.group
>> with tsForm1.tsPageFrame1.page[i]
>> .caption = trips.cname
>> .RecordNo = recno()
>> endwith
>>endscan
>>
>>Is there a way to do that?
>>
>>Thanks,
>>
>>-Michelle
>>
>>
>>
>>>If This is the PageFrame object, than here you have two versions of what you're looking for:
>>>
>>>
with This
>>> for each loPage in .Pages
>>> if loPage.Caption = blabla
>>> Do some code here
>>> endif
>>> endfor
>>>endwith
>>>
>>>or, using a "standard" FOR:
>>>
>>>with This
>>> for lnI = 1 to .PageCount
>>> lcPage = "Page" + ltrim( str( lnI, 2))
>>> if .&lcPage..Caption = blabla
>>> Do some code here
>>> endif
>>> endfor
>>>endwith
>>>
>>>
>>>Vlad