Can I read Access Form definitions programatically

  • Thread starter Thread starter Guest
  • Start date Start date
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!
 
Back
Top