Here's the effect I'm aiming for: the user is browsing the database using a form. Finding the record he wants, he clicks a "print" key, and a report for the record he is viewing appears in preview mode. He can then choose to print or discard it, as he prefers.
Here's how I'm trying to do it: the click method of the button performs a select based on the primary key into a temporary cursor:
select * from imprint into cursor rptcursor ;
where printno = thisform.txt_printno.value
Then I invoke the report in preview mode. Since the new cursor has been selected, the report is based on it. (Shortly after I posted my previous query, I figured out that
you simply empty the report's data environment to let it use whatever appropriate datasource is selected.)
Since the selection value is the primary key, the SELECT is nearly instanteous when I test it manually. But when I try to embed the logic in my form, the SELECT seems to be evaluating every record in the database sequentially. The percent completed bar is displayed, and it takes about two minutes.
The key to this puzzle seems to be that the form has a private datasession associated with it. When I change the datasession type to 1 (default datasession), the SELECT is, once again, nearly instantaneous. But, since this is going to be a shared network app, I really would like to keep my datasessions private.
I'm assuming there's some setting I need to change in the form's data environment, but nothing is jumping out at me. Can anyone shed some light on this one?
Thanks,
BEW
Barbara Weitbrecht
National Air & Space Museum
bew@nasm.si.edu
Barbara Weitbrecht
Archives Division
National Air & Space Museum
Smithsonian Institution
"Magic is real... unless defined as integer"