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

Why does Browse solve this problem?

Status
Not open for further replies.

alvechurchdata

Programmer
Nov 8, 2003
1,737
GB
We have a VFP8 report which works when the exe is called from the development environment but fails with "Their_ref not found" when the exe runs on the user's PC. "Their_ref" is a field of the cursor being printed on the report.

I have single-stepped the code and checked that "Their_ref" does exist in the cursor, the cursor is the current work area, and there is not a memvar named "Their_ref" in my development environment. I have added various debugging messages just before the REPORT FORM in the exe and confirmed that the right work area is selected and that the field "csrParts.Their_ref" does exist and that it does have a valid value.

We made no progress until I put a BROWSE into the code so that we could look at the data on the user's PC. This fixed the problem. The browse window appears, the user presses ESC to close it, and the report prints correctly. If I RELEASE the browse in code or if I stuff ESC into the keyboard buffer to close it then we go back to the original error message.

The only solution I can find is to show a Browse window and have the user close it manually. It doesn't matter whether they click the x widget with the mouse or press ESC on the keyboard.

The report is a new one I've just added to an app written perhaps ten years ago. Can anyone suggest what is going on?

Geoff Franklin
 
Did some grid has a focus when you issue the Report?
If so, move the focus from the grid to some other control and then do REPORT FORM ...
This is a knowing bug when the grid has a focus and you try to do a REPORT FORM ....



Borislav Borissov
 
Hi Geoff,

Yes, and as the Browse is another Grid it has that effect of selecting the alais, but the alias which is printed, so it helps. But I wonder why it wouldn't help with BROWSE NOWAIT / KEYBOARD '{ESC}' PLAIN.

Bye, Olaf.
 
Did some grid has a focus when you issue the Report?

Thanks Olaf and Borislav - that sounds like the right answer.

I must be getting old though. I hit a very similar problem the last time I visited this client about three months ago. Their whole app is keyboard-driven and relies on ON KEY LABEL. The user is always selecting something from a grid and pressing a function key.

The real puzzle is the way that this technique works most of the time and only fails once in a while.

Geoff Franklin
 

Geoff,

I hit a very similar problem the last time I visited this client about three months ago

Didn't you also post the same question here about three months ago? When I saw this thread, I had to double-check the date, because I could've sworn I'd seen the same problem here quite recently, with the same solution. Or was it two other people?

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top