Sub ShowFormStuff()
Dim dbs As DAO.Database
Dim rs, rsR As DAO.Recordset
Dim strSQL As String
Dim x, y As Integer
Set dbs = CurrentDb
strSQL = "DELETE * FROM tblControls"
DoCmd.RunSQL strSQL
strSQL = "SELECT * from tblControls"
Set rs = dbs.OpenRecordset(strSQL, dbOpenDynaset)
strSQL = "SELECT * FROM tblProperty"
'Set rsR = dbs.OpenRecordset(strSQL, dbOpenDynaset)
Set rsR = dbs.OpenRecordset(strSQL, dbOpenDynaset)
With rs
For x = 0 To Forms!frmSelect.Controls.Count - 1
.AddNew
'Debug.Print Forms!frmSelect.Controls.Item(x).Name
.Fields(0).Value = Forms!frmSelect.Controls.Item(x).Name
.Update
For y = 0 To Forms!frmSelect.Controls.Item(x).Properties.Count
'Debug.Print Forms!frmSelect.Controls.Item(x).Properties(y).Name & " " _
; Forms!frmSelect.Controls.Item(x).Properties(y).Value & " End Entry"
Set rsR = dbs.OpenRecordset(strSQL, dbOpenDynaset)
rsR.AddNew
rsR.Fields(0).Value = Forms!frmSelect.Controls.Item(x).Name
If Not IsNull(Forms!frmSelect.Controls.Item(x).Properties(y).Name) Then
rsR.Fields(2).Value = Forms!frmSelect.Controls.Item(x).Properties(y).Name
End If
If Not IsNull(Forms!frmSelect.Controls.Item(x).Properties(y).Value) And _
Len(Forms!frmSelect.Controls.Item(x).Properties(y).Value) > 0 Then
rsR.Fields(3).Value = Forms!frmSelect.Controls.Item(x).Properties(y).Value
End If
rsR.Update
Next y
Next x
End With
End Sub