ACC2000: Unbound Data Access Pages Cannot Contain Fields Based on an Expression (204191)



The information in this article applies to:

  • Microsoft Access 2000

This article was previously published under Q204191
Novice: Requires knowledge of the user interface on single-user computers.

This article applies to a Microsoft Access database (.mdb) and to a Microsoft Access project (.adp).

SYMPTOMS

If you set the ControlSource property of a field on an unbound data access page to an expression, you may receive the following error message:
The setting you entered isn't valid for this property. To see the valid settings for this property, search the Help index for the name of the property.

CAUSE

All expressions in data access pages are analyzed by the Microsoft Jet database engine. Until a data access page is bound to a recordset, Jet will not recognize the page and, in turn, the expression will not be evaluated.

RESOLUTION

Bind the data access page to any recordset available by dragging a field from any table or any query to the page. After the schema of the page includes that bound field, you can delete the field from the page, and you can then use expressions as the ControlSource property of other controls on the page. For an example of how to do this, follow these steps:
  1. Open the sample database Northwind.mdb.
  2. In the Database window, click Pages under Objects, and then click New.
  3. In the New Data Access Page dialog box, click Design View, and then click OK.
  4. If the toolbox is not displayed, click Toolbox on the View menu.
  5. Add a textbox to the data access page.
  6. Set the ControlSource property of the new text box to the following expression:
    Expr1: Now()
    						
    Note that you receive the error message described in the "Symptoms" section of this article. Click OK in the error message.
  7. If the field list is not displayed, click Field List on the View menu.
  8. Drag the CategoryID field from the Categories table to the page.
  9. Reset the ControlSource property of the original text box to the following expression:
    Expr1:  Now()
    					
  10. On the View menu, click Page View. Note that the text box is correctly populated.

MORE INFORMATION

Steps to Reproduce the Behavior

  1. Open the sample database Northwind.mdb.
  2. In the Database window, click Pages under Objects, and then click New.
  3. In the New Data Access Page dialog box, click Design View, and then click OK.
  4. If the toolbox is not displayed, click Toolbox on the View menu.
  5. Add a text box control to the data access page.
  6. Set the ControlSource property of the new text box to the following expression:
    Expr1:  Now()
    					
    Note that you receive the error message mentioned in the "Symptoms" section of this article.

Modification Type:MajorLast Reviewed:6/24/2004
Keywords:kbDAP kberrmsg kbprb KB204191