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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Report doesn't stay in scope

Status
Not open for further replies.

hjohnson

Programmer
Aug 1, 2001
90
0
0
US
I'm sure I am probably just overlooking something simple but it's beginning to drive me crazy. I have a report that when previewed looks ok, but as soon as it's printed it no longer uses the right table.

I have a simple SQL that generates the data for the report.

Select ... Into Cursor Creport
select creport
report form rptForm to printer Prompt preview

The preview is fine, but if I click on the preview to zoom in out or to go to the next page, Status bar indicating the file in use changes and the report ends up with repeating rows of 0's. I tried reference every field with the alias. I hacked the frx to make sure that there is no data enviroment or that and fields are miss referenced with the wrong alias. I even disabled the form from which this is called from thinking that some event somewhere may be triggering something that changes the alias.

If anyone can tell me what I need to do, I would sure be grateful

Thanks

HJ
 
Are you calling any UDFs anywhere that may be changing the alias on you? Make sure you check not only expressions in textboxes, but also Print When conditions, as well as anything on the OnEntry and OnExit commands for each band.


-BP (Barbara Peisch)
 
Thanks for replying!

I doubled checked the report and there are no UDFs being called and any print whens conditions that may be changing aliases as well. Everything looks ok, in fact if I execute the SQL and run the report as a stand-alone, it works perfectly, so I've concluded that it must be something in my form.

My form has a grid on it in which I have a 'Right-click' event in one of the textboxes that creates a popup of several options to perform- one of which is to call the method that creates the reports. If I create just a button to do the same thing, it works fine, but calling the report from the popup is what seems to being causing the the problem. So the problem is temporarily solved, but I would prefer to use the right-click so that the form doesn't become cluttered with command buttons. Any thoughts of things to try or change would sure be appreciated.

Thanks

HJ
 

Try:

push key clear
Select ... Into Cursor Creport
select creport
report form rptForm to printer Prompt preview
pop key

to disable ON KEY LABEL RIGHTMOUSE

ThuVan
 
Thanks for the suggestion. I hadn't thought about using that, but it didn't work anyways.

I believe it has something to do with popup. As soon as a selection is made with the popup is it deactivated with I think is activating something else on the form which changes the alias. I have changed the statement in the popup to set the focus to a commandbutton then issue the click event which works. The click event happens to call the same method as the popup select does. I've got a work around, but I would sure like to figure this one out.

Thanks again for your suggestion

HJ
 
Ah ha! A form with a grid! Grids have this nasty habit of wanting to re-select their ControlSource at just the wrong time. This only happens if the grid has focus, so the workaround is to temporarily move focus off the grid, then you can move it back after the report is complete.


-BP (Barbara Peisch)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top