Solved

creating a function to get form descriptions

Posted on 2006-11-27
4
448 Views
Last Modified: 2012-08-14
I'm using a query to list all the forms in a database and their descriptions. I've done this with queries using

Public Function ReturnQryDesc(ByVal sQuery As String)
    On Error Resume Next
    ReturnQryDesc = CurrentDb.QueryDefs(sQuery).Properties("Description")
End Function

However when I try to revise this for forms:

Public Function ReturnFrmDesc(ByVal sForm As String)
    On Error Resume Next
    ReturnFrmDesc = CurrentDb.FormDefs(sForm).Properties("Description")
End Function

I get the "method or data member not found" error on "FormDefs". How can I create a function that will pull the description of the form?
0
Comment
Question by:eliwil
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 35

Expert Comment

by:Raynard7
ID: 18023195
Hi,

A few things, firstly formDefs does not exist, secondly - there is no "description" for a form.

There is a caption.

if you have a form (fromX)

Forms("frmX").Caption
Forms!frmX.caption

both above will return the caption of the form - this may be what you are looking for, additionally you can only pull this information if the form is open.
0
 
LVL 65

Accepted Solution

by:
rockiroads earned 500 total points
ID: 18023264
try using Containers to get the form descriptions

CurrentDb.Containers("Forms").Documents(sForm).Properties("Description")
0
 
LVL 39

Expert Comment

by:stevbe
ID: 18027545
<aside>

you go Rocki ... a true diehard DAO guru ... using Containers / Documents / Properties the real meat and potatos of the DAO object model :-)

</aside>
0
 
LVL 65

Expert Comment

by:rockiroads
ID: 18028267
:)
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

632 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