Argument | Description |
application | A string expression identifying an application that can participate in a DDE conversation. Usually, application is the name of an .exe file (without the .exe extension) for a Microsoft Windows–based application, such as Microsoft Excel. For example, to initiate a DDE conversation with Microsoft Excel, type "Excel" for the application argument. |
topic | A string expression that is the name of a topic recognized by application. The topic argument is often a document or data file. Check the other application's documentation for a list of possible topics. |
Argument | Description |
item | A string expression that is the name of a data item recognized by application. Check the other application's documentation for a list of possible items. |
data | A string or expression containing the data to send to application. |
=DDESend("Excel", "Sheet1", "R1C1", "Some text")
Suppose you want to send data from a bound control on a Microsoft Access form to a cell on a Microsoft Excel spreadsheet. The ControlSource property of the bound control already contains a field name or expression. You can create another text box or combo box, and set its ControlSource property to an expression including the DDESend function, where data is the name of the bound control. For example, if you have a bound text box called Last Name, you can create another text box and set its ControlSource property to the following:
=DDESend("Excel", "Sheet1", "R1C1", [LastName])
This intermediary control must be either a text box or a combo box. You can't use the name of a bound control as the data argument for a check box or option group.
You can use the DDESend function only in the ControlSource property setting of a text box, option group, check box, or combo box on a form. You cannot call the DDESend function from Visual Basic.
When you use the DDESend function, the control becomes read-only in Form view and Print Preview. Because the ControlSource property is also read-only in Form view and Print Preview, changes to the control must be made in Design view.
The maximum number of DDE conversations that can be open simultaneously is determined by Microsoft Windows and your computer's memory and resources. If the conversation can't be initiated because application isn't running or doesn't recognize topic or if the maximum number of conversations has already been reached, the DDESend function returns a Null.
Note The other application may be configured to ignore your request for a DDE conversation. If so, the DDESend function returns a Null. Similarly, you can set Microsoft Access to ignore requests from other applications: Click Options on the Tools menu, and on the Advanced tab of the Options dialog box, under DDE Operations, select Ignore DDE Requests.
Tip If you need to manipulate another application's objects from Microsoft Access, you may want to consider using Automation.
The following table illustrates how the DDESend function behaves when you use it with each of the controls.
Control | Remarks |
Text box or Combo box | Because the text box or combo box appears blank in Form view and Print Preview, you may want to set its Visible property to False. The data argument can refer to another control. The following example shows how you can send the contents of a control called LastName to a Microsoft Excel worksheet: =DDESend("Excel", "Sheet1", "R1C1", [LastName]) |
Option group | None of the option buttons in the option group is selected in Form view and Print Preview. You may want to make the option group (and its buttons) invisible by setting its Visible property to False. The data argument must contain numeric data, such as "2". If the data argument isn't numeric, the DDESend function doesn't send the information and item isn't changed. |
Check box | The check box is shaded in Form view and Print Preview. You may want to make it invisible by setting its Visible property to False. The data argument must contain numeric data, such as "2". If the data argument isn't numeric, the DDESend function doesn't send the information and item isn't changed. |