ACC97: Report Auto List Members Shows Generic Ctrl Object List (160823)



The information in this article applies to:

  • Microsoft Access 97

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

SYMPTOMS

The Auto List Members feature in Microsoft Access 97 helps you type Visual Basic for Applications code by displaying a list of an object's properties and methods as you type.

However, when you type the name of a report control in the class module of a report, the Auto List Members box displays a generic list of methods and properties instead of those specific to that type of control. When you type the name of a form control in the class module of a form, the Auto List Members box displays a specific list of methods and properties for that type of control.

CAUSE

Report controls display a generic list of methods and properties because they do not support the same methods and properties as their counterparts on a form. For example, you cannot use the standard methods of a text box, label, or object frame control in a report the same way you can on a form because a report control does not trigger events.

RESOLUTION

If you want to see a specific list of methods and properties for a control on a report, you must explicitly declare the control object. For example, if your report has a text box control called Text0, then the following line of code displays a generic list of methods and properties in the Auto List Members box:
   Me!Text0.
				

However, if you dimension a variable of type TextBox as in the following example, you see a specific list of text box methods and properties in the Auto List Members box:
   Dim x as TextBox
   Set x = Me!Text0
   x.
				

MORE INFORMATION

Steps to Reproduce Behavior


  1. Open the sample database Northwind.mdb.
  2. On the Tools menu, click Options.
  3. Click the Module tab.
  4. Click Auto List Members if it is not already selected.
  5. Click OK in the Options dialog box.
  6. Open the Employees form in Design view.
  7. On the View menu, click Code.
  8. Type the following portion of a procedure:
          Sub AutoMem()
             Me!EmployeeId.
    						

    Note that when you type the period after EmployeeId, the Auto List Members box displays the methods and properties of a text box control object. The list contains AddColon, AfterUpdate, AllowAutoCorrect, and many others.
  9. Close the Employees form without saving it.
  10. Open the Catalog report in Design view.
  11. On the View menu, click Code.
  12. Type the following portion of a procedure:
           Sub AutoMem()
              Me!ProductID.
    						

    Note that when you type the period after ProductID, the Auto List Members box displays a generic list of methods and properties for a control object.
  13. Retype the code in step 12 so it looks as follows:
           Sub AutoMem()
              Dim x as TextBox
              Set x = Me!ProductID
              x.
    						

    Note that when you type the period after the x, the Auto List Members box displays the same list of methods and properties that you see in step 8.
  14. Close the Catalog report without saving it.

REFERENCES

For more information about Auto List Members, search on the phrase "Auto List Members option (Module window)," using the Microsoft Access 97 Help Index.

Modification Type:MajorLast Reviewed:9/25/2003
Keywords:kbprb KB160823