opendialogsheet
FORM
,
OPTION
,
VALUE

The opendialogsheet statement opens a form from the current database as a sheet dialog (attached to the current window).


Parameters

This statement has three parameters:

form – is the name of the form to open.

option – in addition to the form name, this statement can have one or more additional option/value parameter pairs that modify the operation of the statement. Each pair has two parts, the option name (this parameter) and the option value. See the discussion below for more information.

value – option value.


Description

This statement opens a form in a sheet dialog (attached to the current window). As long as this sheet is open, nothing else can be done in the associated window. The only way to close this dialog window is with the closedialog statement. The dialog window will not have any scroll bars or tool palette.

Note: In most cases you won’t want to use the opendialogsheet statement directly. Instead, you should use the rundialog statement.

The procedure below opens the form Transaction Preferences in a 4 inch by 6 inch dialog sheet attached to the current window. The procedure then pauses so the user can fill in the dialog (see pause and resume).

opendialogsheet "Transaction Preferences","Rectangle",rectanglesize(1,1,4*72,6*72)
pause ""

Note: Only one dialog sheet can be associated with a window at a time. You cannot open a second nested sheet (this is an Apple restriction).

Options

In addition to the form name, this statement can have one or more additional option/value parameter pairs that modify the operation of the statement. For example, these options can modify the appearance and operation of the dialog window. Each pair has two parts, the option name (this parameter) and the option value, like this:

opendialogsheet name,option,value,option,value,option,value

The available options are described below. Note that unlike a modal dialog, there are no options for title or close buttons, because dialog sheets don’t have these features.

Database

To open a form in a different database, use the database option. This example opens the form Report from the Members database as a sheet dialog.

opendialogsheet "Report","Database","Members"

The specified database must already be open.

Normally when you use the database option, the current database changes to the the specified database while the dialog is open. However, if you also specify that stay is true, the current database will remain active. If you use this option, make sure that the form you are opening doesn’t display or edit fields that are not in the current database. Usually you will use this option with forms that don’t use any fields, only variables. In this example, the Status form from the Utility database is opened, but Utility does not become the current database – the current database stays the name (hence the name of the option).

opendialogsheet "Status","Database","Utility","Stay",true(),"Clone",true()

As shown in the example above, the stay option is often used with the clone option (see below).

Rectangle

This option allows you to specify the exact location and size of the new dialog. This example opens a 3“ by 5” dialog sheet. Note: The position of the rectangle is ignored, only the size is used.

opendialogsheet "Preferences","Rectangle",rectanglesize(1, 1, 72*3, 72*5)

Note: The location can also be specified with the setwindowrectangle statement. If both are used, the rectangle specified in the * opendialogsheet* statement will be used.

Clone

This true/false option specifies whether the form should be opened as a “clone” dialog. Theoretically, this could allow you to open multiple clone dialogs with the same form. More importantly, this allows you to make programmatic changes to the dialog that will be discarded as soon as the dialog is closed. We recommend using this option, and in fact the rundialog statement defaults to this.


See Also


History

VersionStatusNotes
10.0NewNew in this version.