ACC2000: DDE Statements Invalid in List Box or Combo Box Control (209719)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q209719
Advanced: Requires expert coding, interoperability, and multiuser skills.

SYMPTOMS

If you use a dynamic data exchange (DDE) function as the ControlSource property of a list box or a combo box, the box will be empty when you view it in Form view. However, if you view the form in Datasheet view, the first object in the DDE data will appear.

Using a DDE function in the RowSource property causes an error message in both Form and Datasheet views of the form.

RESOLUTION

Using code, you can create a list function that returns to a list box or combo box. You can use any code routine to obtain the information used in the list, including DDE commands.

STATUS

This behavior is by design.

MORE INFORMATION

The ControlSource property of a list box or combo box may be blank if the control is unbound, or may contain the name of the field that the control is bound to; it may not contain a DDE function.

The RowSource property of a list box or combo box may contain a list of values, the name of a table or query, or an SQL string. This property provides the list of values that the user may select from.

Steps to Reproduce Behavior

  1. Open a Microsoft Excel spreadsheet and enter a text string in cell A1.
  2. Save the spreadsheet as Test.xls, but do not close the spreadsheet. Leave Test.xls open.
  3. Create a new form in Microsoft Access and add a list box with the following property setting:
       Object: List Box
       ----------------------------------------------
       ControlSource: =DDE("Excel","Test.xls","R1C1")
    					
  4. View the form in Form view. Note that the list box is empty in Form View.
  5. View the form in Datasheet view. Note that the data from Microsoft Excel appears in the list.

REFERENCES

For more information about using the ControlSource property, click Microsoft Access Help on the Help menu, type ControlSource in the Office Assistant or the Answer Wizard, and then click Search to view the topics returned.

Modification Type:MajorLast Reviewed:12/12/2002
Keywords:kbdta kbinterop kbprb KB209719