Update - I tweaked the code to set the Initial State of Form Controls to False (except for "Default Info") in Form Load event:
Code:
SetControls True, "Default Info"
SetControls False, "User Info", "ENS", "HRIS PB", "HRIS.NET", "WexHealth"
SetControls False, "NewRole", "NewRoleENS", "NewRolePB", "NewRoleWex", "NewRoleNet"
SetControls False, "Screen Info", "Screen Info Net", "Screen Info ENS", "Screen Info PB"
I also changed the lengthy IF..THEN statements to SELECT..CASE like below.. Though if anything, the form seems to be a little bit slower after updating it to the below..?
Code:
Select Case strAppType
Case "ENS"
ShowControls True, "ENS"
Select Case strRequestTypeENS
Case "Modify_Existing_User_Add", "Modify_Existing_User_Remove"
ShowControls True, "User Info"
Case "Create_New_Group"
ShowControls True, "NewRole"
ShowControls True, "NewRoleEns"
Case Else
ShowControls True, "Screen Info"
End Select
Case "HRIS"
ShowControls True, "HRIS PB"
Select Case strRequestTypePB
Case "Modify_Existing_User_Add_Role", "Modify_Existing_User_Remove_Role"
ShowControls True, "User Info"
Case "Create_New_Group"
ShowControls True, "NewRole"
ShowControls True, "NewRolePb"
Case Else
ShowControls True, "Screen Info"
End Select
Case "HRIS_NET"
Select Case strRequestTypeNet
Case "Modify_Existing_User_Add_Role", "Modify_Existing_User_Remove_Role"
ShowControls True, "User Info", "HRIS.NET"
Case "Create_New_Role"
ShowControls True, "NewRole", "HRIS.NET"
ShowControls True, "NewRoleNet", "HRIS.NET"
Case Else
ShowControls True, "Screen Info", "HRIS.NET"
End Select
Case "E1"
ShowControls True, "WexHealth"
Select Case strRequestTypeWex
Case "Create_New_Role"
ShowControls True, "NewRole"
Case Else
ShowControls True, "Screen Info"
End Select
End Select
'
'Select Case strRequestTypeENS
' Case "Modify_Existing_User*"
' ShowControls True, "User Info"
'End Select