I've been trying to change the design of all my forms. For this I've created a function which opens each form, performs the changes, then saves and closes it. I can change every control accessing it with ControlType, but I don't know how to access and perform changes on the backcolor of a form. I've tried some ways but with no success, i tried me.formheader.backcolor or even CurrentDb.Containers("forms").Documents(j).backcolor I want to do this (which i did for one form):
Me.FormHeader.BackColor = RGB(225, 225, 255)
Me.FormFooter.BackColor = RGB(225, 225, 255)
Me.Detail.BackColor = RGB(242, 242, 242)
My code so far looks something like this: (it works for me)
Public Function SetFormDefaultsIleana()
Dim i, j As Integer
Dim wrkDefault As Workspace
Dim ctrl As Control
Dim frmName As String
Set wrkDefault = DBEngine.Workspaces(0)
For i = 0 To CurrentDb.Containers.Count - 1
If CurrentDb.Containers(i).Name = "Forms" Then
For j = 0 To CurrentDb.Containers("forms").Documents.Count - 1
frmName = CurrentDb.Containers("forms").Documents(j).Name
DoCmd.OpenForm frmName, acDesign
For Each ctrl In Forms(frmName)
If ctrl.ControlType = acLabel Then
DoCmd.SetWarnings False
ctrl.ForeColor = RGB(0, 0, 0)
'..
Next
DoCmd.Save acForm, frmName
DoCmd.Close acForm, frmName
Next j
End If
Next i
End Function