If e.Table.Current IsNot Nothing Then
Select Case e.Table.Current("订单状态")
Case "已上线"
Forms("产线2").Controls("CheckBox1").checked = True
Forms("产线2").Controls("CheckBox1").Enabled = False
Case "生产已完成"
Forms("产线2").Controls("CheckBox1").checked = True
Forms("产线2").Controls("CheckBox1").Enabled = False
Forms("产线2").Controls("CheckBox2").checked = True
Forms("产线2").Controls("CheckBox2").Enabled = False
msgbox(e.Table.Current("订单编号"))
Case "品管正在检验"
Forms("产线2").Controls("CheckBox1").checked = True
Forms("产线2").Controls("CheckBox1").Enabled = False
Forms("产线2").Controls("CheckBox2").checked = True
Forms("产线2").Controls("CheckBox2").Enabled = False
Forms("产线2").Controls("CheckBox3").checked = True
Forms("产线2").Controls("CheckBox3").Enabled = False
Case "品管检验通过"
Forms("产线2").Controls("CheckBox1").checked = True
Forms("产线2").Controls("CheckBox1").Enabled = False
Forms("产线2").Controls("CheckBox2").checked = True
Forms("产线2").Controls("CheckBox2").Enabled = False
Forms("产线2").Controls("CheckBox3").checked = True
Forms("产线2").Controls("CheckBox3").Enabled = False
Forms("产线2").Controls("CheckBox4").checked = True
Forms("产线2").Controls("CheckBox4").Enabled = False
Forms("产线2").Controls("CheckBox5").checked = False
Forms("产线2").Controls("CheckBox5").Enabled = False
Case "品管检验未过"
Forms("产线2").Controls("CheckBox1").checked = True
Forms("产线2").Controls("CheckBox1").Enabled = False
Forms("产线2").Controls("CheckBox2").checked = True
Forms("产线2").Controls("CheckBox2").Enabled = False
Forms("产线2").Controls("CheckBox3").checked = True
Forms("产线2").Controls("CheckBox3").Enabled = False
Forms("产线2").Controls("CheckBox4").checked = False
Forms("产线2").Controls("CheckBox4").Enabled = False
Forms("产线2").Controls("CheckBox5").checked = True
Forms("产线2").Controls("CheckBox5").Enabled = False
Case "已入库"
Forms("产线2").Controls("CheckBox1").checked = True
Forms("产线2").Controls("CheckBox1").Enabled = False
Forms("产线2").Controls("CheckBox2").checked = True
Forms("产线2").Controls("CheckBox2").Enabled = False
Forms("产线2").Controls("CheckBox3").checked = True
Forms("产线2").Controls("CheckBox3").Enabled = False
Forms("产线2").Controls("CheckBox4").checked = True
Forms("产线2").Controls("CheckBox4").Enabled = False
Forms("产线2").Controls("CheckBox5").checked = False
Forms("产线2").Controls("CheckBox5").Enabled = False
Forms("产线2").Controls("CheckBox6").checked = True
Forms("产线2").Controls("CheckBox6").Enabled = False
End Select
End If
问题来了,checkbox的勾选不是根据所选择的行动态变化,而是不了选择哪一行,checkbo的勾选都是固定的。我知道代码有问题,可又不知道怎么实现这个功能。请帮忙。多谢。