Dim r As Row = e.Table.current If forms("窗口2").opened AndAlso r IsNot Nothing Then If r.DataRow.RowState <> DataRowState.Added Then Forms("窗口2").controls("客户").Enabled = False Forms("窗口2").controls("子客户").Enabled = False Forms("窗口2").controls("品种").Enabled = False Forms("窗口2").controls("包装").Enabled = False Forms("窗口2").controls("车号1").Enabled = False Forms("窗口2").controls("车号2").Enabled = False Forms("窗口2").controls("车号3").Enabled = False Forms("窗口2").controls("车号4").Enabled = False Forms("窗口2").controls("车号5").Enabled = False Forms("窗口2").controls("车号6").Enabled = False Forms("窗口2").controls("车号7").Enabled = False Forms("窗口2").controls("车号8").Enabled = False Forms("窗口2").controls("车号9").Enabled = False Forms("窗口2").controls("车号10").Enabled = False Else Forms("窗口2").controls("客户").Enabled = True Forms("窗口2").controls("子客户").Enabled = True Forms("窗口2").controls("品种").Enabled = True Forms("窗口2").controls("包装").Enabled = True Forms("窗口2").controls("车号1").Enabled = True Forms("窗口2").controls("车号2").Enabled = True Forms("窗口2").controls("车号3").Enabled = True Forms("窗口2").controls("车号4").Enabled = True Forms("窗口2").controls("车号5").Enabled = True Forms("窗口2").controls("车号6").Enabled = True Forms("窗口2").controls("车号7").Enabled = True Forms("窗口2").controls("车号8").Enabled = True Forms("窗口2").controls("车号9").Enabled = True Forms("窗口2").controls("车号10").Enabled = True End If End If
|