Solved

creating a function to get form descriptions

Posted on 2006-11-27
4
444 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

734 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