I have a load-all subfile that offers the user an Fkey to only display records that contain a predetermined value in a specific field.
Here's the problem; If the user presses the Fkey and there are no records that contain the value required to select the record for display, I present the user with a message stating there were no records found but they are still looking at the records initially displayed, loaded before they pressed the Fkey.
How do I clear the screen so the user does not see these initial records that now give them a conflicting situation - a message stating there are no records and a screen full of old records?
Software/Hardware used:
ASKED:
January 22, 2008 4:36 PM
UPDATED:
April 20, 2012 5:17 PM
Sorry, I should have added that my subfile is in a window with record selection including update and delete.
Could I use a duplicate subfile control record without the overlay keyword since the main one does have the keyword in effect?
I conditioned the Overlay keyword on the SFL control record to be off when there are no records to display. Now, my message stating there are no records displays above an empty SFL. The only problem now is the function key record is no longer displayed. This is better than what I had but I would like to see the Fkey record somehow.
You can use the ERASE keywords conditioned on when you don’t display the subfile.
Think of it as SFLCLR working in the virtual file and ERASE working on the screen in memory.
The method I use is to create a format which overlays the subfile:
A R D@NDT1 TEXT('No data in subfile') A OVERLAY PUTOVR A 10 30' 'Then, in the code:
If 14 is OFF, there are (now) no records in the subfile, and the “no data” format overlays the subfile, which clears it off the screen.
Regards!
Wow, this text editor is savage!
Er…. the code sample in my previous post has been mauled by the editor. It appears that the “@” symbol is taken to be an email address. Please look at it like this (“at” symbol replaced by #) :
I hope that is clearer.
Birddon,
I don’t know if your monitoring this thread any more due to it’s age but I used your idea on another SFL where I had a SFLMSG being displayed on line 18 of a 24 line display, above the FKey’s and below the last line of the SFL.
Using the other methods described in this thread caused me to lose the SFLMSG and the FKey’s. Your method of conditioning the ERASE keyword with the off indicator for the SFLDSP keyword worked perfectly, exactly what I was looking for – Thanks again.
Writing the Control Record without the OVERLAY active did the trick – Thanks