Hi Brendan,
I made the chnges below, the form I am working on is a Calendar and has 7
subforms, it works only up to 2 subforms and slows the showing of conditional
formatting I tried different timer settings but don't know if that is the
answer.
Thanks for your patience,
Emilio
Private Sub Form_Open(Cancel As Integer)
Dim aob As AccessObject
Dim ctls As Controls
Dim ctl As Control
'if testing with a new form, be sure to save the form before running
'this code -
'the AccessObject object doesn't exist until the form has been saved.
Set aob = CurrentProject.AllForms(Me.Name)
Set ctls = Me.JobScheduleSubformFriday.Controls
Set ctls = Me.JobScheduleSubformMonday.Controls
Set ctls = Me.JobScheduleSubformSaturday.Controls
Set ctls = Me.JobScheduleSubformSunday.Controls
Set ctls = Me.JobScheduleSubformThursday.Controls
Set ctls = Me.JobScheduleSubformTuesday.Controls
Set ctls = Me.JobScheduleSubformWednesday.Controls
For Each ctl In ctls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
aob.Properties.Add ctl.Name & "ColumnWidth", ctl.ColumnWidth
End If
Next ctl
Me.TimerInterval = 250
End Sub
Private Sub Form_Timer()
Dim aob As AccessObject
Dim ctls As Controls
Dim ctl As Control
'Make sure the timer event doesn't get
'called again while we're still processing.
Me.TimerInterval = 0
Set aob = CurrentProject.AllForms(Me.Name)
Set ctls = Me.JobScheduleSubformFriday.Controls
Set ctls = Me.JobScheduleSubformMonday.Controls
Set ctls = Me.JobScheduleSubformSaturday.Controls
Set ctls = Me.JobScheduleSubformSunday.Controls
Set ctls = Me.JobScheduleSubformThursday.Controls
Set ctls = Me.JobScheduleSubformTuesday.Controls
Set ctls = Me.JobScheduleSubformWednesday.Controls
For Each ctl In ctls
If ctl.ControlType = acTextBox Or ctl.ControlType = acComboBox Then
ctl.ColumnWidth = aob.Properties(ctl.Name & "ColumnWidth")
End If
Next ctl
Me.TimerInterval = 250
End Sub