Solved

creating a function to get form descriptions

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now