ACC2002: Unable to Set the Recordset Label of the Navigation Bar in Browse Mode (275093)



The information in this article applies to:

  • Microsoft Access 2002

This article was previously published under Q275093
Moderate: Requires basic macro, coding, and interoperability skills.

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

SYMPTOMS

The label on a record navigation bar of a data access page returns to its default when you click on the bar.

CAUSE

Setting the InnerText property does not change the template that is used to fill the record navigation control.

STATUS

This behavior is by design.

MORE INFORMATION

You cannot change the RecordsetLabel property at run-time.

Steps to Reproduce the Behavior

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 follow these steps on a copy of the database.

  1. Open the Northwind sample database.
  2. Create a new data access page that is based on the Categories table, and then add CategoryName field to the page.
  3. Add a command button to the page, and then make the following property assignments:
       Id: cmdNewRecord
       InnerText: New Record
    					
  4. In the Microsoft Script Editor, click the arrow in the Object box, and then click cmdNewRecord in the drop-down list.
  5. Click the arrow in the Event box, and then click onclick in the drop-down list. Note that script similar to the following is inserted into the top of your HTML window:
    <script language=vbscript for=cmdNewRecord event=onclick>
    <!--
    
    -->
    </script>
    					
  6. Modify this script as follows:
    <script language=vbscript for=cmdNewRecord event=onclick>
     <!--
      MSODSC.DefaultRecordset.AddNew
      CategoriesNavLabel.innerText = "New Category 1 of 1"
     -->
    </script>
    					
  7. Close the Microsoft Script Editor, click Yes to save changes, and then save the page with the default name of Page1.htm.
  8. In page design, click Page View on the View menu, and then browse through the page. Note that the current label on the Categories navigation bar has text similar to:

    Categories 1 of 8

  9. Click the New Record button and note that the navigation label now displays as New Category 1 of 1.
  10. Click anywhere on the navigation bar and note that the label returns to the default display that you saw in step 7.

REFERENCES

For more information about setting the label for the record navigation control, in the Microsoft Script Editor, click Microsoft Script Editor Help on the Help menu, type RecordsetLabel Property in the Office Assistant or the Answer Wizard, and then click Search to view the topic.

Modification Type:MajorLast Reviewed:9/26/2003
Keywords:kbnofix kbprb KB275093