Hi not sure if my earlier post was sent due to idle time so here I go again....
On my main form when I press the save button it has to loop through several sub forms within tabs and determine if the optiongroup within them are set to a certain value.
How would I do a single loop structure to accomplish this from my main form calle frmMain. Presently I am doing it separately for each form as below:
thanks
On my main form when I press the save button it has to loop through several sub forms within tabs and determine if the optiongroup within them are set to a certain value.
How would I do a single loop structure to accomplish this from my main form calle frmMain. Presently I am doing it separately for each form as below:
Code:
For Each ctl In Form_frmHeader.Controls
Select Case ctl.ControlType
Case acOptionGroup
If ctl.Value = 2 Then
Correct = True
Exit For
End If
End Select
Next ctl
For Each ctl In Form_frmLines.Controls
Select Case ctl.ControlType
Case acOptionGroup
If ctl.Value = 2 Then
Correct = True
Exit For
End If
End Select
Next ctl
For Each ctl In Form_frmSummary.Controls
Select Case ctl.ControlType
Case acOptionGroup
If ctl.Value = 2 Then
Correct = True
Exit For
End If
End Select
Next ctl
For Each ctl In Form_frmDocHist.Controls
Select Case ctl.ControlType
Case acOptionGroup
If ctl.Value = 2 Then
Correct = True
Exit For
End If
End Select
Next ctl
For Each ctl In Form_frmNotes.Controls
Select Case ctl.ControlType
Case acOptionGroup
If ctl.Value = 2 Then
Correct = True
Exit For
End If
End Select
Next ctl
Comment