sub5
Programmer
- Oct 12, 2005
- 104
Hello All,
I want to output all the property settings for all the forms in an Access97 database to a text file.
ie if control1 onclick event setting is =fncEmail(), I want that to be my output.
I only seem to be able to get it to demand the value (rather than the setting) for the property when the form is open in normal view.
I have tried messing around with object variables but that hasn't helped.
Any ideas, is it possible?
Public Function AllformsData()
Dim dbs As Database
Dim doc As Document
Dim form1 As String
Dim frm As Form
Dim ctl As control
Dim prp As Property
Dim frmName As Form
Dim ctlName As control
Dim prpName As Property
Set dbs = CurrentDb
Open "TEXTproperty.txt" For Output As #1
For Each doc In dbs.Containers!Forms.Documents
form1 = doc.Name
DoCmd.OpenForm form1, acDesign
For Each frm In Forms
'Set frmName = frm.Name
Write #1, "Form: " & frm.Name
For Each ctl In frm.Controls
'Set ctlName = frmName.Name
Write #1, "Control: " & ctl.Name
For Each prp In ctl.Properties
'Set prpName = frmName.Name
Write #1, prp.Name & "=" & prp
'Write #1, prp.Name & "=" & prpName
Next prp
Next ctl
DoCmd.Close acForm, form1
Next frm
Next doc
Close #1
End Function
I want to output all the property settings for all the forms in an Access97 database to a text file.
ie if control1 onclick event setting is =fncEmail(), I want that to be my output.
I only seem to be able to get it to demand the value (rather than the setting) for the property when the form is open in normal view.
I have tried messing around with object variables but that hasn't helped.
Any ideas, is it possible?
Public Function AllformsData()
Dim dbs As Database
Dim doc As Document
Dim form1 As String
Dim frm As Form
Dim ctl As control
Dim prp As Property
Dim frmName As Form
Dim ctlName As control
Dim prpName As Property
Set dbs = CurrentDb
Open "TEXTproperty.txt" For Output As #1
For Each doc In dbs.Containers!Forms.Documents
form1 = doc.Name
DoCmd.OpenForm form1, acDesign
For Each frm In Forms
'Set frmName = frm.Name
Write #1, "Form: " & frm.Name
For Each ctl In frm.Controls
'Set ctlName = frmName.Name
Write #1, "Control: " & ctl.Name
For Each prp In ctl.Properties
'Set prpName = frmName.Name
Write #1, prp.Name & "=" & prp
'Write #1, prp.Name & "=" & prpName
Next prp
Next ctl
DoCmd.Close acForm, form1
Next frm
Next doc
Close #1
End Function