问题:当后期对某行数据进行修改时,点击修改按钮打开录入窗口时,控件的可用状态始终停留在最后一次录入的状态,必须退出系统,重新进入才行,即使选择其它行,对应的控件还是灰色的,想实现修改不同行时,控件的可用权限如何做到随着当前行已经录入的产品来变化,怎么解决?谢谢!
Dim dr As DataRow = e.DataRow
For Each r As Row In Tables("销售订单").Rows
r("序") = r.index+1
Next
Tables("销售订单").save
Select Case e.DataCol.Name
Case "木门","垭口","单门"
If e.NewValue = True Then
Dim nms() As String = {"木门","垭口","单门"}
For Each nm As String In nms
If nm <> e.DataCol.Name AndAlso dr(nm) = True Then
dr(nm) = False
End If
Next
End If
If dr("木门") = True Then '变动后的值是True(已勾选)
Forms("木门销售订单三级").controls("型号Label").enabled = True
Forms("木门销售订单三级").controls("型号_button").enabled = True
Forms("木门销售订单三级").controls("型号").Enabled = True
Forms("木门销售订单三级").controls("塔线型号Label").enabled = False
Forms("木门销售订单三级").controls("塔线型号").Enabled = False
Forms("木门销售订单三级").controls("套板型号Label").enabled = False
Forms("木门销售订单三级").controls("套板型号_button").enabled = False
Forms("木门销售订单三级").controls("套板型号").Enabled = False
ElseIf dr("垭口") = True Then
Forms("木门销售订单三级").controls("型号Label").enabled = False
Forms("木门销售订单三级").controls("型号_button").enabled = False
Forms("木门销售订单三级").controls("型号").Enabled = False
Forms("木门销售订单三级").controls("塔线型号Label").enabled = True
Forms("木门销售订单三级").controls("塔线型号").Enabled = True
Forms("木门销售订单三级").controls("套板型号Label").enabled = True
Forms("木门销售订单三级").controls("套板型号_button").enabled = True
Forms("木门销售订单三级").controls("套板型号").Enabled = True
ElseIf dr("单门") = True Then
Forms("木门销售订单三级").controls("型号Label").enabled = False
Forms("木门销售订单三级").controls("型号_button").enabled = False
Forms("木门销售订单三级").controls("型号").Enabled = False
Forms("木门销售订单三级").controls("塔线型号Label").enabled = True
Forms("木门销售订单三级").controls("塔线型号").Enabled = True
Forms("木门销售订单三级").controls("套板型号Label").enabled = False
Forms("木门销售订单三级").controls("套板型号_button").enabled = False
Forms("木门销售订单三级").controls("套板型号").Enabled = False
End If
End Select