retrieving the description field in Table/Query properties through code

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob

    #1

    retrieving the description field in Table/Query properties through code

    Hi all,

    I write the description of a lot of my tables and queries in the
    description section in the properties (when you right click on the
    table or query). Is there a method or a property that use use to
    retrieve that description from code somehow?

    Cheers

  • Marshall Barton

    #2
    Re: retrieving the description field in Table/Query properties through code

    Bob wrote:
    >I write the description of a lot of my tables and queries in the
    >description section in the properties (when you right click on the
    >table or query). Is there a method or a property that use use to
    >retrieve that description from code somehow?

    Just refer to the object's Description property:

    CurrentDb.Table Defs!tablename. Properties!Desc ription

    The tricky part is that you will get a trappable error if
    you have not set the description. Just check the error
    number and do something appropriate.

    --
    Marsh

    Comment

    • Allen Browne

      #3
      Re: retrieving the description field in Table/Query properties through code

      If the table has a Description, you can get it from:
      CurrentDb.Table Defs("Table1"). Properties.("De scription")

      If it has no description, that will generate an error, so use error
      handling.

      For a query, replace TableDefs with QueryDefs. However, if the query has no
      description, Access may get confused and give you the description of one of
      the tables in the query instead of recognising that there's none.

      --
      Allen Browne - Microsoft MVP. Perth, Western Australia
      Tips for Access users - http://allenbrowne.com/tips.html
      Reply to group, rather than allenbrowne at mvps dot org.

      "Bob" <scrawford@colo nialfirststate. com.auwrote in message
      news:1169073675 .790052.153840@ 51g2000cwl.goog legroups.com...
      >
      I write the description of a lot of my tables and queries in the
      description section in the properties (when you right click on the
      table or query). Is there a method or a property that use use to
      retrieve that description from code somehow?
      >
      Cheers

      Comment

      • Smartin

        #4
        Re: retrieving the description field in Table/Query properties throughcode

        Bob wrote:
        Hi all,
        >
        I write the description of a lot of my tables and queries in the
        description section in the properties (when you right click on the
        table or query). Is there a method or a property that use use to
        retrieve that description from code somehow?
        >
        Cheers
        >
        Hi Bob, yes there is:

        ? dbengine(0)(0). TableDefs("MyTa ble").Propertie s("description" )
        ? dbengine(0)(0). QueryDefs("MyQu ery").Propertie s("description" )

        Cheers,
        --
        Smartin

        Comment

        • Bob

          #5
          Re: retrieving the description field in Table/Query properties through code

          Thanks everyone!

          Smartin wrote:
          Bob wrote:
          Hi all,

          I write the description of a lot of my tables and queries in the
          description section in the properties (when you right click on the
          table or query). Is there a method or a property that use use to
          retrieve that description from code somehow?

          Cheers
          >
          Hi Bob, yes there is:
          >
          ? dbengine(0)(0). TableDefs("MyTa ble").Propertie s("description" )
          ? dbengine(0)(0). QueryDefs("MyQu ery").Propertie s("description" )
          >
          Cheers,
          --
          Smartin

          Comment

          Working...