Microsoft KB Archive/165193

= ACC97: Cannot View Expressions in Forms Exported to IDC or ASP =

Article ID: 165193

Article Last Modified on 1/19/2007

-

APPLIES TO


 * Microsoft Access 97 Standard Edition

-



This article was previously published under Q165193



Moderate: Requires basic macro, coding, and interoperability skills.



SYMPTOMS
If you create an HTX/IDC or ASP file from a form in Microsoft Access 97, when you open it in your Web browser you see empty fields in your IDC datasheet, or you see #Expression in one or more fields of your ASP form.



CAUSE
Microsoft Access does not preserve expressions on forms in HTX/IDC or ASP format.



RESOLUTION
Do not use expressions in a form control's ControlSource property on any form you want to view in HTX/IDC or ASP format.

Instead, try to create a query that contains all of your expressions, base your form on that query, and then bind the controls on your form to the expressions in your query. Using this technique, your expressions will appear in the HTX/IDC or ASP file that you create. A disadvantage of using this method is that your expressions appear in text boxes on an ASP form, which makes them appear to be editable; however, any changes you make to an expression field on an ASP form will be dropped as soon as you commit and refresh the record.

Also, Microsoft Access 97 does output expressions to files in HTML format. If you can use a static HTML format instead of the dynamic HTX/IDC or ASP file formats, consider saving your form as an HTML file as a workaround that will preserve the form's expressions.



Steps to Reproduce Behavior
 Start Microsoft Access and open the sample database Northwind.mdb. Open the Employees (page break) form in Design view.  Note that the EmployeeName control in the Form Header section has its ControlSource property set to the following expression:

     =[FirstName] & " " & [LastName]  Switch the form to Form view and note that the employee's full name appears above the photograph in the Form Header for each record. On the File menu, click Save As/Export.</li> In the Save As dialog box, point "To an External File or Database," and then click OK.</li> In the "Save Form 'Employees (page break)' In" dialog box, select "Microsoft Active Server Pages (*.asp)" in the Save As Type box. In the Save In box, select a folder on your Web server where you have Execute permissions, and then click Export.</li> In the "Microsoft Active Server Pages Output Options" dialog box, type the name of a System DSN on your Web server that points to the Northwind sample database in the Data Source Name box; type the uniform resource locator (URL) for the location on your Web server where you are saving the file in the Server URL box, for example http:// /scripts, and then click OK.</li> Start Microsoft Internet Explorer 3.0 and type the URL to the Employees (page break).asp file in the Address box. For example:

http:// /scripts/Employees (page break).asp

When the form appears, note that the EmployeeName control displays #Expression instead of the full name of the employee.</li></ol>

Additional query words: blank empty

Keywords: kbinterop kbprb KB165193

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.