With Tables( "领导值班表")
If .Current Is Nothing OrElse .Current.DataRow.RowState = DataRowState.Unchanged Then '如果当前行未曾修改
Tables("领导值班表").AddNew()
End If
End With
With Tables("主任值班表")
If .Current Is Nothing OrElse .Current.DataRow.RowState = DataRowState.Unchanged Then '如果当前行未曾修改
Tables("主任值班表").AddNew()
End If
End With
With Tables( "早班值班表")
If .Current Is Nothing OrElse .Current.DataRow.RowState = DataRowState.Unchanged Then '如果当前行未曾修改
Tables("早班值班表").AddNew()
End If
End With
With Tables("中班值班表")
If .Current Is Nothing OrElse .Current.DataRow.RowState = DataRowState.Unchanged Then '如果当前行未曾修改
Tables("中班值班表").AddNew()
End If
End With
With Tables("晚班值班表")
If .Current Is Nothing OrElse .Current.DataRow.RowState = DataRowState.Unchanged Then '如果当前行未曾修改
Tables("晚班值班表").AddNew()
End If
End With
建立了一个新增按钮,把以上代码写进去之后,执行的时候,就出现报错
;单个插入或者同时插入4个数据,就不会报错,注释掉了前面4段代码,最后一条就报错,把最后一条注释掉了,完美插入数据,咋解决?检查过了表和表结构没有问题。