感觉以下代码很是别扭,却又不知道该如何优化,请高手指点,谢谢!
Dim s,s1,s2,s3,mj,gz,qt As String
s1 = "产品名称|80|商标要求|80|色彩要求|80|特殊要求|80|订购数量|70|折扣|40|"
s3 = "中心孔|60|孔间距|60|安装孔|60|孔数量|60"
mj = "模具|40|"
gz = "工装|40|"
qt = "其他|40|"
If e.Form.Controls("CheckBox3").checked = True Then
If e.Form.Controls("CheckBox4").checked = True Then
If e.Form.Controls("CheckBox5").checked = True Then
s2 = mj & gz & qt
Else
s2 = mj & gz
End If
Else
If e.Form.Controls("CheckBox5").checked = True Then
s2 = mj & qt
Else
s2 = mj
End If
End If
Else
If e.Form.Controls("CheckBox4").checked = True Then
If e.Form.Controls("CheckBox5").checked = True Then
s2 = gz & qt
Else
s2 = gz
End If
Else
If e.Form.Controls("CheckBox5").checked = True Then
s2 = qt
Else
s2 = ""
End If
End If
End If
s = s1 & s2 & s3
e.form.controls("Table1").Table.SetColVisibleWidth(s)