>No Craig, I´m saying that when I run the code outside from the form it work good, I mean if the report has 20 pages it show me Page 1 from 20, Page 2 from 20,......
>But when I use the code in a form it give me the value Page 1 from 1, Page 2 from 1, .....
>Do you understand...?
I was trying to clarify that I knew exactly what you are getting.
Here's the code from your original post:
parameter cto, inicio, final
public totalpaginas
select 0
use ttidist alias reporte
select * from ttidist into cursor repxcto ;
where circuito=cto and fecha_opr between inicio and final ;
order by fecha_opr
report form repxcto to prompt noconsole && Problem line is here
totalpaginas = _pageno
report form repxcto preview noconsole
use in repxcto
close all
return .t.
---
Change this line:
report form repxcto to prompt noconsole
to this:
report form repxcto to file dummy.txt noconsole
Sometimes when you just go to CONSOLE, the total number of pages gets screwed up, but it seems to work fine if you go to a file.
Craig Berntson
MCSD, Microsoft .Net MVP, Grape City Community Influencer