Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    144
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How do I (VBA/Access 2002)

    I have a couple questions.

    How do I rename a module?

    Can I display a list of field names in the VBA editor? When using the fields collection or a recordset I'd like a list box of fields. I have a function that prints them, just wondering if there's an easier way.

    Is there a way to have basic exception handlers added every time I create a new procedure or function myself?

    Any help would be appreciated.

    Thanks.

  2. #2
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How do I (VBA/Access 2002)

    To rename a module just open the Project and Properties windows, select the module, and in the Properties Window, type in a new name. Check out the view menu, it should give you at least some of the info you're looking for. I'm not sure of the basic exceptions...
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How do I (VBA/Access 2002)

    You can rename a module by selecting the module in the database window, right-clicking it, and selecting Rename from the context menu.

    You can't display a list of field names in the VBA Editor, but intellisense will give you a list of members when you're referring to a form's controls and its underlying recordset.

    Download and install MZ-Tools 3.0, which is freeware. Among its tools is an error handler template which you can customize for this purpose.
    Charlotte

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: How do I (VBA/Access 2002)

    > How do I rename a module?

    In the Modules section of the database window, select a module and press F2 to edit the name. In the Visual Basic Editor, select a module in the Project Explorer, then edit the (Name) property in the Properties window/pane.

    > Can I display a list of field names in the VBA editor? When using the fields collection or a recordset I'd like a list box of fields. I have a function that prints them, just wondering if there's an easier way.

    When working in a form or report module, IntelliSense lists fields (among many other things) when you type Me followed by a period. Otherwise, the answer is no. The Visual Basic Editor has no way of knowing which fields belong to a recordset object, since it is created in runtime.

    > Is there a way to have basic exception handlers added every time I create a new procedure or function myself?

    See for example MZTools, a free add-in with this capability and lots more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •