Can I read Access Form definitions programatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to get access to Forms programatically - ala Database Documentor
 
What exactly do you want to know about the form?

For example, the following code will list all of the controls on a given
form:

Sub DocumentForm(FormName As String)

Dim ctlCurr As Control

DoCmd.OpenForm FormName, acDesign, , , acFormReadOnly, acHidden

For Each ctlCurr In Forms(FormName).Controls
Debug.Print ctlCurr.Name
Next ctlCurr

DoCmd.Close acForm, FormName, acSaveNo

End Sub


--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


FatFurryGuy said:
I am trying to get access to Forms programatically - ala Database
Documentor
 
This is exactly what I needed; I tried something similar – driven from the
AllForms collection, but kept stumbling over code executed in Load/Open
procedures. Hadn’t considered acFormReadOnly & acHidden. Thanks much
Douglas!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top