Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control report from form 1

Status
Not open for further replies.

JaPoChi

Technical User
Feb 19, 2011
11
RO
Hello again! I have a new question. I want to control the data from the report with the data from the form. So, I have a text box in a form which retains a numeric data (in my case a number). What I want to do next is to do a report and to show only the fields that have the number lower than the number from the form.
I have thought at something like - in field properties-> expresion: mytable.myfield<myform.textbox1.value. But of course, it doesn't work. So, I need help!
 
You're on the right track, but you don't do it in "field properties".

The easiest way is to as a FOR clause to your REPORT command:

Code:
REPORT FORM MyReport PREVIEW ;
  FOR MyTable.MyField < Thisform.Text1.Value

There are other possibilities as well, such as creating a cursor which contains only the records you want in the report, and then using the cursor to control the report.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top