Question : Is there a way to print the properties for a given control in Access 2007?

I am verifying the poper property setting on a lot of controls on various access forms. I would like to be able to print the properties, so that I can check offf each against a master property list.

Is there a way to select a control and prin the propertie for that control?

Answer : Is there a way to print the properties for a given control in Access 2007?

this code will dump the forms control properties to a Text File

1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
Sub getControlProp(frm As String, sCtl As String)
Dim ctl As Control
Dim prp As Property
Open CurrentProject.Path & "\" & frm & "_Controls.txt" For Output As #1
On Error GoTo getPropErr
DoCmd.OpenForm frm, acDesign, , , , acHidden
For Each ctl In Forms(frm).Controls
    If ctl.Name = sCtl Then
    Print #1, ctl.Properties("Name")
    For Each prp In ctl.Properties
        Print #1, vbTab & prp.Name & " = " & prp.Value
    Next prp
    End If
Next ctl
DoCmd.Close acForm, frm, acSaveNo
Set ctl = Nothing
Set prp = Nothing
Close #1
Exit Sub

getPropErr:
    If Err = 2187 Then
        Print #1, vbTab & prp.Name & " = Only available at design time."
        Resume Next
    Else
        Print #1, vbTab & prp.Name & " = Error Occurred: " & Err.description
        Resume Next
    End If
End Sub
Random Solutions  
 
programming4us programming4us