Unanswered: Nestted Select Case setting values on SubForm Controls
I am trying to set values in controls on subforms, where the subform is on a tab control, so that I can autofill the default working hours for employees, without having to key all days individually. Here is my code..... ANY help anyone can offer would be GREATLY appreciated.
On Error GoTo Err_Handler
Dim DefaultTS As Form, WeekDay, MyControl As Control, xName As String
Dim ActiveSubForm As String
ActiveSubForm = sfrm
'Check each data entry control for change and record
'old value of Control.
For Each WeekDay In DefaultTS.Controls
'Only check data entry type controls.
Select Case WeekDay.ControlType
' Skip the active Sub Form.
If WeekDay.Name <> sfrm Then
For Each MyControl In WeekDay.Controls
'AutoFill the Controls
Select Case MyControl.Name
Case "Start": MyControl.Value = EnteredStart
Case "Finish": MyControl.Value = EnteredFinish
Case "Break": MyControl.Value = EnteredBreak
Case "Hours": MyControl.Value = EnteredHours
Set MyControl = Nothing
Set WeekDay = Nothing
If Err.number <> 64535 Then
MsgBox "Error #: " & Err.number & vbCrLf & "Description: " & Err.Description