Hi Frank,
When you place a 'report' button on your form, you select a search component for the records you want to print. Some of the options are
1. You could leave this blank in which case it will print ALL record in the table (not just those displayed in the tablegrid)
2. You could specify tablegrid1 (I'm guessing that's what you're doing in your example) in which case the report will print all the records displayed in the tablegrid (if no row is highlighted) or just a single record (if a selected row is higlighted) .
3. You could use a search criteria (which is the option I would go for). How that works is as follows (using the example in the attachment).
* place an edit field on the form (in my example, it's form1.edit1)
* define that field as the thing you want to report on (in my example, it's an order number)
* (optional) set the field's filter property to %s% (to allow for wildcard searches)
* on the report button, specify edit1 as the report's search criteria.
Then when you run the report, if edit1 is blank, it will report all the rows in the tablegrid. If you specify an order no', it will report just that specific row. If you specify a partial value (in my example, enter RET) and it will report all the RET order no's.
However, there is one additional thing that I would do. You have already added form1.edit1 as a search criteria for the report but you can use the same search criteria (form1.edit1) to do a normal 'search' as well. Why? Because using the same search criteria (form1.edit1) for both the 'search' and the 'report' synchronises what you see in the tablegrid and what gets printed on the report.
All of which sounds way more complicated than it actually is. Please have a look at the attachment and you'll see how the report mirrors the tablegrid selection.
One final thing (optional) is to copy the report button on form1 and paste it onto form2. Then you can run the report from either form (but as you'll probably have guessed, when you run it from form2 it will print out the individual record you're looking at).
Shout out if something's not clear.
Derek.
Post's attachments frank.zip 338.21 kb, 246 downloads since 2020-08-19