Show All

Get information about the objects used in your Visual Basic code

You can use the Object Browser to view and navigate among the objects available in Microsoft Access and other applications that support Microsoft Visual Basic, as well as the methods and properties of each object. When you locate a method or property in the Object Browser, you can paste it into the active module.

Locate a method or property

  1. Open any module in the Microsoft Visual Basic Editor.
  2. Click Object Browser on the toolbar.
  3. In the Project/Library box (the upper-left box), click Access or another library.
  4. In the Classes box, click the object you're interested in.
  5. In the Members Of box, click the method or property you want.

View Help on a class, method, event, or property

View objects in the Microsoft Office XP Object Library

To view objects provided by the Microsoft Office XP Object Library, such as command bar objects, you must set a reference to this library.
  1. In the Microsoft Visual Basic Editor, click References on the Tools menu.
  2. Select the Microsoft Office XP Object Library check box.

Paste a method or property syntax into a module

  1. Select the method or property in the Object Browser.
  2. In the bottom section of the Object Browser, select the syntax you want to paste.
  3. Click Copy To Clipboard in the Object Browser.
  4. Click in the Code window of the module where you want to paste the syntax.
  5. Click Paste on the toolbar.

Microsoft Access pastes the method or property syntax into the module.

Note   After pasting syntax for Sub procedures, you need to remove any parentheses surrounding placeholders in the syntax.

Display relevant objects, properties, and methods in the Microsoft Visual Basic Editor

You can get assistance while you're writing Visual Basic code. When you type the name of an object, followed by a space or opening parenthesis, Microsoft Access displays a list of relevant objects, properties, and methods that could follow the object name.

  1. Open any module in the Microsoft Visual Basic Editor.

  2. On the Tools menu, select Options, click the Editor tab, and then select the Auto List Members check box. There are several keys you can use to enter an item from the list into the current line of code.

Key Effect
TAB Enters the item
SPACEBAR Enters the item followed by a space
ENTER Enters the item and moves the cursor to the next line

You can make the list disappear by pressing ESC.