How to go to data sheet in a procedure?

In prior version of Panorama I had quite a number of procedures that would do something with the records and then show results in the data sheet instead of the primary form I used. I think the command was “gosheet” since that is what I had to removed in each procedure. I can’t figure out what would be the equivalent — to do a record selection for example, and then move from my form to the data sheet to see the listing. I have studied the Help files but don’t see advice searching the “go” function or anything on "data sheet."
Suggestions?

— Richard

The opensheet statement opens the data sheet for the current database.

Panorama X doesn’t allow a window to be switched from one type of view to another. So in a form window, you can goform to switch another form, but you can’t switch to the data sheet in the same window. You have to open the data sheet in a new window using the opensheet statement, as Tom mentioned.

Thanks Tom and Jim. I looked at opensheet in the Help file. Tried to duplicate what it suggests there. So I added on what was suggested in Help to my script as you see here.
__
Selectall
RemoveSummaries “7”
Select «Annual Meetings» contains “S17”
Field “Lastname”
SortUp
call “.number Records”
Firstrecord
Field Lastname
window “PC Students (Panorama 6)”
opensheet
__
But when I run the procedure I get this message that the window not available. (I had put in the image of this warning but when I try to reply it tells me “new users” can only put up one image. Prejudice?)

Yet when I open the data sheet, that is the name of the window at the top.

So I must not be understanding it. Further suggestions?

Thanks,
Richard

The Window command just switches you to a window that is already open. Leave that command out. The OpenSheet command will both open the data sheet, and make it the front window.

Dave,
Thanks, that worked. But why then does the Help file show it like this?

window "Price List:Secret"
opensheet

The Help file says this will open the data sheet if already open or not. I am still confused.

I see Dave already answered your original question but I’ll submit what I was about to regardless.

The error is generated by the window statement because that statement is designed to take you to a window that is already open and since the datasheet is not already opened you get the error. The example in the Help file is using the window statement to open a “secret” window so that the following opensheet statement opens the datasheet of that file. To open the datasheet of the current file just use opensheet

Here is an example that will open the datasheet of the current file as a new window that is offset from the active window by 10 pixels.

replace:

window "PC Students (Panorama 6)"
opensheet

with:

    opensheet```

Note that if the datasheet is already open it will ignore the `setwindowrectangle` statement and simple bring the datasheet to the front. If you just use the `opensheet` statement by itself the datasheet will open in the position and size it was last opened.

Gary,
Thanks for the clarification. I appreciate the help.