Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Hey Guys,

    I know how to:

    set = rs.openrecordset("Table1")

    But how can you select the open/active table. IE in Excel there would be a .active

    The reason I'm trying to work this out is so I can run user selected macro on the ACTIVE table.

    And yes I know I can do it in a Form.

    Any ideas.

    TX in Advance

    More details available on Request

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    End users should never work directly with objects in the database window, so there is no need to work with the "active" table. But if you want to know the currently selected object, you can use Application.CurrentObjectName to get its name and Application.CurrentObjectType to get its type (acTable, acQuery, acForm etc.)

  3. #3
    2 Star Lounger
    Join Date
    Mar 2007
    Location
    Wikltshire UK
    Posts
    152
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Excellent Thats what I was after. saves me messing around with File selection

    TX Yet again Hans

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,624
    Thanks
    3
    Thanked 60 Times in 60 Posts
    The reason I'm trying to work this out is so I can run user selected macro on the ACTIVE table.
    Are you actually planning to run a macro from VBA? Once you open the table using DAO you can do pretty much anything you want in the module. What sort of things do the macros do to the table?
    Wendell

Posting Permissions

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