Microsoft KB Archive/891123

= No results are returned when you click a hyperlink in a data access page in Access 2000, Access 2002, or Access 2003 =

Article ID: 891123

Article Last Modified on 1/25/2005

-

APPLIES TO


 * Microsoft Access 2000 Standard Edition
 * Microsoft Access 2002 Standard Edition
 * Microsoft Office Access 2003

-





SYMPTOMS
In Microsoft Access 2000, Microsoft Access 2002, or Microsoft Office Access 2003, no results are returned when you click a hyperlink in a data access page and the following conditions are true:
 * The data access page includes a hyperlink that opens another data access page.
 * The hyperlink is configured to use a server filter. For example, when you insert the hyperlink in the data access page, you click Server Filter, and you specify a server filter.



CAUSE
This issue occurs if the field names that you specify in the server filter contain spaces. The user interface where you specify a server filter does not permit the correct syntax to create a server filter if the field names contain spaces. Therefore, the server filter does not work.



RESOLUTION
To resolve this issue, make sure that the names of the fields in your database tables do not contain spaces if you reference those field names in your server filter.

For example, if your server filter references a field such as &quot;Customer ID,&quot; rename the Customer ID field in your database tables to a name such as &quot;CustomerID.&quot; Then modify your server filter to reference the new field name.



WORKAROUND
To work around this issue, use a command button control instead of a hyperlink control in the data access page. Using a command button control requires that you add code to the onclick event to redirect users to the other data access page. To do this, follow these steps:

CAUTION If you follow the steps in this example, you modify the sample database Northwind.mdb. You may want to back up the Northwind.mdb file and to follow these steps on a copy of the database.

Note For each version of Access, the location of your files may be different from the location that is specified in these steps.

Add spaces to the CustomerID field names
 Start Access 2003. On the Help menu, point to Sample Databases, and then click Northwind Sample Database. On the Northwind Traders splash screen appears, click OK, and then click the Close button in the Main Switchboard dialog box. In the Objects pane, click Tables, right-click Customers, and then click Design View. Click to put the insertion point between &quot;Customer&quot; and &quot;ID&quot; in the CustomerID field, and then press SPACEBAR. The CustomerID field name appears as follows:

Customer ID

 Click Save, and then close the Customers table.</li> Right-click each table that contains the CustomerID field, such as the Orders table, and then follow steps 5 through 7 to modify the CustomerID field name so that a space appears between &quot;Customer&quot; and &quot;ID&quot; in the field name.</li></ol>

Create new data access pages
<ol> In the Objects pane, click Pages, and then click New.</li> In the New Data Access Page dialog box, click AutoPage: Columnar, click Orders in the Choose the table or query where the object's data comes from list, and then click OK.</li> On the File menu, click Save, type OrdersDAP.htm in the File name box, and then click Save.</li> If the following message box appears, click OK:

The connection string of this page specifies an absolute path. The page might not be able to connect to data through the network. To connect through the network, edit the connection string to specify a network (UNC) path.

</li> In the Northwind : Database (Access 2000 file format) dialog box, click Pages in the Objects pane, and then click New.</li> In the New Data Access Page dialog box, click AutoPage: Columnar, click Customers in the Choose the table or query where the object's data comes from list, and then click OK.</li> On the File menu, click Save, type CustomersDAP.htm in the File name box, and then click Save.</li> If the following message box appears, click OK:

The connection string of this page specifies an absolute path. The page might not be able to connect to data through the network. To connect through the network, edit the connection string to specify a network (UNC) path.

</li></ol>

Add a command button to the CustomersDAP page
<ol> In the Northwind : Database (Access 2000 file format) dialog box, click CustomersDAP, and then click Design.</li> Click Command Button in the toolbox, and then click a blank area on the page.</li> In the Command Button Wizard, click Cancel.</li> Right-click the new command button, and then click Element Properties.</li> Click the Other tab, type OrdersButton in the ID box, and then type Orders in the InnerText box.</li> Right-click the new command button, and then click Microsoft Script Editor.</li> <li> In the Document Outline pane, click OrdersButton, position the insertion point after the </BUTTON> tag, and then paste the following Visual Basic script code:

Note If you need to, modify the path of the OrdersDAP.htm file in the following code example. <SCRIPT language=vbscript event=onclick for=OrdersButton> Dim loc loc = &quot;file:///C:\Program Files\Microsoft Office\OFFICE11\SAMPLES\OrdersDAP.htm?serverfilter=&quot; & chr(34) & &quot;[Customer ID]='&quot; & [Customer ID].value & &quot;'&quot; & chr(34) window.navigate loc </SCRIPT> </li> <li>On the File menu, click Save, and then on the File menu, click Exit to close the Microsoft Script Editor.</li> <li>On the File menu in Access, click Save.

Open CustomersDAP.htm in Microsoft Internet Explorer to test the new command button.</li></ol>

<div class="references_section">