Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

How to get a Query description from code?

How to get a Query description from code?
0
icad01
Asked:
icad01
1 Solution
 
icad01Author Commented:
.
0
 
Rey Obrero (Capricorn1)Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now