Академический Документы
Профессиональный Документы
Культура Документы
t=125730 Function test2() Dim accobj As AccessObject Dim ctl As Control Dim strDoc As String For Each accobj In CurrentProject.AllForms strDoc = accobj.Name DoCmd.OpenForm strDoc, acDesign For Each ctl In Forms(strDoc).Controls Debug.Print strDoc & vbTab & ctl.Name
End Function
Dim Dim Dim Dim Dim Dim Dim Dim Dim Dim Dim
frm As Form strObject As String, aob As AccessObject, obj As Object strTemp As String, strList As String strTempForm As Variant myObject As Object k As Long frmControl As Control frmControls As Controls controltype As String intcnt As Integer i As Integer
For i = 0 To intcnt - 1 astrCtlName(i, 0) = frm(i).Name 'Use ControlType to determine the Type of Control Select Case frm(i).controltype Case acLabel: astrCtlName(i, 1) = "Label" Case acRectangle: astrCtlName(i, 1) = "Rectangle" Case acLine: astrCtlName(i, 1) = "Line" Case acImage: astrCtlName(i, 1) = "Image" Case acCommandButton: astrCtlName(i, 1) = "Command Button" Case acOptionButton: astrCtlName(i, 1) = "Option button" Case acCheckBox: astrCtlName(i, 1) = "Check box" Case acOptionGroup: astrCtlName(i, 1) = "Option group" Case acBoundObjectFrame: astrCtlName(i, 1) = "Bound object frame "
Case acTextBox: astrCtlName(i, 1) = "Text Box" Case acListBox: astrCtlName(i, 1) = "List box" Case acComboBox: astrCtlName(i, 1) = "Combo box" Case acSubform: astrCtlName(i, 1) = "SubForm" Case acObjectFrame: astrCtlName(i, 1) = "Unbound object frame or chart" Case acPageBreak: astrCtlName(i, 1) = "Page break" Case acPage: astrCtlName(i, 1) = "Page" Case acCustomControl: astrCtlName(i, 1) = "ActiveX (custom) Cotrol" Case acToggleButton: astrCtlName(i, 1) = "Toggle Button" Case acTabCtl: astrCtlName(i, 1) = "Tab Control" End Select
controltype = astrCtlName(i, 1) rTarget.AddNew rTarget("FormName") = strTemp rTarget("FormCaption") = Eval("forms!" & strTemp & ".caption") rTarget("ObjectName") = frmControl.Name rTarget("ControlTipTextValue") = frmControl.ControlTipText rTarget("Type") = controltype rTarget.Update
http://www.expertsexchange.com/Microsoft/Development/MS_Access/Access_CodingMacros/Q_24683434.html
Sub Paly() Dim frm As AccessObject, mdl As Module Dim lngReturn As Long, ctl As Control Dim obj As AccessObject, dbs As Object Dim fname As String Dim prp As Property Set dbs = Application.CurrentProject For Each frm In dbs.AllForms Debug.Print frm.Name DoCmd.OpenForm frm.Name, acDesign, , , , acHidden For Each ctl In Forms(frm.Name).Controls Debug.Print vbTab & ctl.Name For Each prp In ctl.Properties On Error Resume Next Debug.Print vbTab & vbTab & prp.Name & " = " & prp.Value On Error GoTo 0 Next prp Next ctl DoCmd.Close acForm, frm.Name, acSaveNo Next frm Set ctl = Nothing Set prp = Nothing End Sub