Public Sub fFindControlsForms()
On Error Resume Next
Dim obj As AccessObject, dbs As Object, ctl As control, countFrms As Integer, countCtls As Integer, prp As Property
Set dbs = Application.CurrentProject
countFrms = 0
countCtls = 0
Open MyDocuments & "\FindControlsForms.txt" For Append As #1
For Each obj In dbs.AllForms
If obj.Name = "111frmTest" Or obj.Name = "frmDialog" Then
DoCmd.OpenForm obj.Name, acDesign, , , , acHidden
'Print #1, "FORM NAME " & obj.Name
For Each ctl In Forms(obj.Name).Controls
If ctl.ControlType = 104 Then
Print #1, "FORM NAME " & obj.Name & " CONTROL NAME "; ctl.Name & " > " & ctl.ControlType & " > " & ctl.BackColor&; " > " & ctl.Shape
Debug.Print "FORM NAME " & obj.Name & " CONTROL NAME "; ctl.Name & " > " & "ctl.shape"; ctl.Shape; ""
' For Each prp In ctl.Properties
' Print #1, vbTab & "ctl." & prp.Name & " = " & prp.Value
'Next prp
ctl.BackStyle = 1
ctl.Transparent = False
ctl.UseTheme = True
ctl.Shape = 1
ctl.Bevel = 0
ctl.Glow = 0
ctl.Shadow = 0
ctl.SoftEdges = 0
ctl.Gradient = 12
ctl.QuickStyle = 0
ctl.QuickStyleMask = 0
ctl.BackColor = 14136213
ctl.BackThemeColorIndex = 4
ctl.BackTint = 60
ctl.BackShade = 100
ctl.BorderStyle = 1
ctl.OldBorderStyle = 1
ctl.BorderLineStyle = 0
ctl.BorderWidth = 0
ctl.BorderColor = 14136213
ctl.BorderThemeColorIndex = 4
ctl.BorderTint = 60
ctl.BorderShade = 100
ctl.HoverColor = 15060409
ctl.HoverThemeColorIndex = 4
ctl.HoverTint = 40
ctl.HoverShade = 100
ctl.PressedColor = 9592887
ctl.PressedThemeColorIndex = 4
ctl.PressedTint = 100
ctl.PressedShade = 75
ctl.HoverForeColor = 4210752
ctl.HoverForeThemeColorIndex = 0
ctl.HoverForeTint = 75
ctl.HoverForeShade = 100
ctl.PressedForeColor = 4210752
ctl.PressedForeThemeColorIndex = 0
ctl.PressedForeTint = 75
ctl.PressedForeShade = 100
ctl.FontName = "Calibri"
ctl.fontsize = 11
ctl.alignment = 2
ctl.FontWeight = 400
ctl.FontUnderline = False
ctl.FontItalic = False
ctl.FontBold = 0
ctl.ForeColor = 4210752
ctl.ThemeFontIndex = 1
ctl.ForeThemeColorIndex = 0
ctl.ForeTint = 75
ctl.ForeShade = 100
ctl.GridlineStyleTop = 0
ctl.GridlineStyleBottom = 0
ctl.GridlineStyleLeft = 0
ctl.GridlineStyleRight = 0
ctl.GridlineColor = 10921638
ctl.GridlineWidthTop = 1
ctl.GridlineWidthBottom = 1
ctl.GridlineWidthLeft = 1
ctl.GridlineWidthRight = 1
ctl.TopPadding = 30
ctl.BottomPadding = 30
ctl.LeftPadding = 30
ctl.RightPadding = 30
ctl.HorizontalAnchor = 0
ctl.VerticalAnchor = 0
ctl.DisplayWhen = 0
ctl.ReadingOrder = 0
ctl.TextFontCharSet = 0
ctl.GridlineThemeColorIndex = 1
ctl.GridlineTint = 100
ctl.GridlineShade = 65
ctl.Gradient = 12 'oddly enough, when this property is set in the order that the properties are read, it does not stick. Here it works.
countCtls = countCtls + 1
End If
Next
DoCmd.Close acForm, obj.Name, acSaveYes
countFrms = countFrms + 1
Else
End If
Next obj
Close #1
Debug.Print "CountForms:"; countFrms
Debug.Print "CountControls:"; countCtls
End Sub
So i have attached the code in case it helps anyone. Thanks to Rey for the baseline code i used to get started.In the mean time i have found that not only must the dlls or ocxs be registered, they must (in some cases only) be the exact same version to ensure that they work.The must be matched to the other components on which they depend, which is why is maddening to try and piece together a fix for things like this, and why it becomes increasingly difficult to support applications that are not upgraded in a timely manner. In particular, and app like yours, that comes from a 1.1 version, is highly susceptible to these sorts of things, since they tend to grow and develop over the years, and become dependent on technology that becomes deprecated. Sooner or later MSFT stops being concerned with those technologies (like the OCW, for example), and you're left with trying to make things work in environments where they're not intended to work. That's when "Dll Hell" comes into play, and essentially that's where you're at.
Dim ctl As Control, frmX as string
frmX="NameOfForm"
DoCmd.OpenForm frmX, acDesign, , , , acHidden
For Each ctl In Forms(frmX).Controls
Debug.Print ctl.Name & " > " & ctl.ControlType
Next
DoCmd.Close acForm, frmX, acSaveNo