Solved

creating a function to get form descriptions

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

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

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…
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

777 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