打印按钮的代码为:
If Tables("产品表").Current("已付款") = True '你打打印代码Else MessageBox.show("不能打印未付款的记录","提示",MessageBoxButtons.OK,MessageBoxIcon.Information)End If
很简单,设置在产品表的DatacolChanging事件中:
If e.DataCol.name = "已付款" Then If e.Newvalue = True Then For Each dr As DataRow In e.DataRow.GetChildRows("订单") If dr("已付款") = False Then e.cancel = True Exit For End If Next End IfEnd If