If e.DataCol.Name = "结束日期" Then
If e.NewValue <> Nothing AndAlso e.DataRow.IsNull("开始日期") = False
If Format(e.DataRow("开始日期"), "yyyyMM") <> Format(e.NewValue, "yyyyMM") Then
Dim result As DialogResult = MessageBox.Show("是否跨月?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = DialogResult.No Then
e.cancel = True
End If
End If
End If
End If
If e.DataCol.Name = "开始日期" Then
If e.NewValue <> Nothing AndAlso e.DataRow.IsNull("结束日期") = False
If Format(e.DataRow("结束日期"), "yyyyMM") <> Format(e.NewValue, "yyyyMM") Then
Dim result As DialogResult = MessageBox.Show("是否跨月?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If result = DialogResult.No Then
e.cancel = True
End If
End If
End If
End If