All,
Can someone please show me a nicer way to achieve the following:
For info:
1) All of the subform apart form frm_PrintDate_Subform have an EmployeeID control
2) I can and will be changing the 'LetUser', 'TCUser' to simply 'OrginalOperator' on every table
i.e. my syntax for the above will be:
If IsNull([frm_CompAA_Subform]![OriginalOperator]) Then
I'm looking for the correct way to loop through the Subforms and achieve the above,
any further information needed I can provide it.
Thanks,
Can someone please show me a nicer way to achieve the following:
Code:
If IsNull([frm_UTC1_Subform]![TCUser]) Then
[frm_UTC1_Subform]![EmployeePid] = Null
Else
[frm_UTC1_Subform]![EmployeePid] = SystoPid([frm_UTC1_Subform]![TCUser])
End If
If IsNull([frm_UTC2_Subform]![TCUser]) Then
[frm_UTC2_Subform]![EmployeePid] = Null
Else
[frm_UTC2_Subform]![EmployeePid] = SystoPid([frm_UTC2_Subform]![TCUser])
End If
If IsNull([frm_UTC3_Subform]![TCUser]) Then
[frm_UTC3_Subform]![EmployeePid] = Null
Else
[frm_UTC3_Subform]![EmployeePid] = SystoPid([frm_UTC3_Subform]![TCUser])
End If
If IsNull([frm_STC_Subform]![TCUser]) Then
[frm_STC_Subform]![EmployeePid] = Null
Else
[frm_STC_Subform]![EmployeePid] = SystoPid([frm_STC_Subform]![TCUser])
End If
If IsNull([frm_Letter_DL15_1_Subform]![LetUser]) Then
[frm_Letter_DL15_1_Subform]![EmployeePid] = Null
Else
[frm_Letter_DL15_1_Subform]![EmployeePid] = SystoPid([frm_Letter_DL15_1_Subform]![LetUser])
End If
If IsNull([frm_Letter_DL15_2_Subform]![LetUser]) Then
[frm_Letter_DL15_2_Subform]![EmployeePid] = Null
Else
[frm_Letter_DL15_2_Subform]![EmployeePid] = SystoPid([frm_Letter_DL15_2_Subform]![LetUser])
End If
If IsNull([frm_Letter_Replies_Subform]![LetUser]) Then
[frm_Letter_Replies_Subform]![EmployeePid] = Null
Else
[frm_Letter_Replies_Subform]![EmployeePid] = SystoPid([frm_Letter_Replies_Subform]![LetUser])
End If
If IsNull([frm_HandOff_Subform]![HoUser]) Then
[frm_HandOff_Subform]![EmployeePid] = Null
Else
[frm_HandOff_Subform]![EmployeePid] = SystoPid([frm_HandOff_Subform]![HoUser])
End If
If IsNull([frm_CompTBS_Subform]![CoUser]) Then
[frm_CompTBS_Subform]![EmployeePid] = Null
Else
[frm_CompTBS_Subform]![EmployeePid] = SystoPid([frm_CompTBS_Subform]![CoUser])
End If
If IsNull([frm_CompPDCS_subform]![CoUser]) Then
[frm_CompPDCS_subform]![EmployeePid] = Null
Else
[frm_CompPDCS_subform]![EmployeePid] = SystoPid([frm_CompPDCS_subform]![CoUser])
End If
If IsNull([frm_CompAA_Subform]![CoUser]) Then
[frm_CompAA_Subform]![EmployeePid] = Null
Else
[frm_CompAA_Subform]![EmployeePid] = SystoPid([frm_CompAA_Subform]![CoUser])
End If
If IsNull([frm_CompCA_Subform]![CoUser]) Then
[frm_CompCA_Subform]![EmployeePid] = Null
Else
[frm_CompCA_Subform]![EmployeePid] = SystoPid([frm_CompCA_Subform]![CoUser])
End If
For info:
1) All of the subform apart form frm_PrintDate_Subform have an EmployeeID control
2) I can and will be changing the 'LetUser', 'TCUser' to simply 'OrginalOperator' on every table
i.e. my syntax for the above will be:
If IsNull([frm_CompAA_Subform]![OriginalOperator]) Then
I'm looking for the correct way to loop through the Subforms and achieve the above,
any further information needed I can provide it.
Thanks,