Solved

How to get a Query description from code?

Posted on 2007-11-14
2
236 Views
Last Modified: 2012-08-13
How to get a Query description from code?
0
Comment
Question by:icad01
2 Comments
 

Author Comment

by:icad01
ID: 20279808
.
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 20279834
try this function

Function GetQryDefDesc(ByVal sQryDef As String) As String
   Dim db   As Object
   Dim Qdef As Object

   Set db = CurrentDb
   On Error Resume Next
   Set Qdef = db.QueryDefs(sQryDef)
   If Err Then
      MsgBox "Could not access " & sQryDef
      Exit Function
   End If

   GetQryDefDesc = Qdef.Properties("Description")
   If Err Then
      GetQryDefDesc = ""
   End If
   On Error GoTo 0
   Set Qdef = Nothing
   Set db = Nothing
End Function
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question