UserControl2 Command (DDE)

Microsoft Query

Show All

UserControl2 Command (DDE)

Activates Microsoft Query and allows users to create, open, or edit a query as if they were running Microsoft Query as a standalone program.

This command is available only on the system channel.

Note   The difference between the UserControl command and the UserControl2 command is that UserControl2 allows you to specify a command to add to the File menu that closes all queries created in Microsoft Query and returns to the destination program without any data.

Syntax

UserControl2(exittext, canceltext, appstate, newquery)

exittext   The name of the Exit command used to exit Microsoft Query after a DDE conversation. If this argument is omitted, "Return" is used.

canceltext   The name of the menu item used to cancel the current session. The command is added to the bottom of the File menu in Microsoft Query. If this argument is omitted, no new menu item is created.

appstate   The state of the program. Can be one of the following values.

Value Description
1 Normal
2 Minimized (Microsoft Windows only)
3 Maximized
If this argument is omitted, the current state of Microsoft Query is used.

newquery   Specifies whether the Choose Data Source dialog box is displayed when Microsoft Query is started during a DDE conversation. Can be True or False.

If newquery is True, the Choose Data Source dialog box is displayed, asking the user to select a data source. If newquery is False (the default), no dialog box is displayed and any open queries for that channel are accessible.