DataColChanging事件
If e.DataCol.Name = "B" AndAlso e.NewValue <> Nothing Then If e.NewValue < e.DataRow("A") Then msgbox("不能小于A") e.cancel = True ElseIf e.newvalue > Date.today Then msgbox("不能大于今天") e.cancel = True End If End If