>I have create 'student.dbf' with fields having namely 1. Regno 2.Name 3.class 4.community 5.Place.
>I have designed 'Print.scx' form, in that i have placed two text boxes namely 1. txtfrom 2. txtto and one command button namely 'cmdprint'.
>I want to print the student record what I enterd regno in txtfrom and txtto. for example I have enterd starting regno '11001' in txtfrom and ending regno '11020' in txtto and click the command button the printer print the records starting from 11001 to 11020.
>
>How to write code?
The best way to do this is to select the data first. Select to a cursor (temporary table). For example:
local lcFrom, lcTo
lcFrom = ThisForm.TxtFrom.Value
lcTo = ThisForm.TxtTo.Value
select * from student;
where regno between lcFrom and lcTo;
order by Regno;
into cursor Temp
You must also create a report that prints the desired data. Assuming you already created your report, you can run it as follows:
report form MyReport preview
report form MyReport to printer prompt
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)