Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
各位老师:
客户表有a 和 b两列,我想在订单录入的时候ab两列不重复,就是说,当a重复且b重复的时候,提示录入员已经存在这个客户,并且定位到这个客户,代码如何写,写在什么事件中
竟然帮助中有,找了半天没找到。。。
碰到一个问题:
If e.DataCol.Name = "姓名" Then
Dim dr As DataRow
dr = e.DataTable.Find("姓名 = '" & e.NewValue & "'")
If dr IsNot Nothing And dr("发货日期") = e.DataRow("发货日期") Then
MessageBox.Show("此客户今天订单已录入,请查询客户姓名并加录订单!")
e.Cancel = True
End If
End If
If e.DataCol.Name = "发货日期" Then
Dim dr As DataRow
dr = e.DataTable.Find("发货日期 = #" & e.newValue & "#")
If dr IsNot Nothing And dr("姓名") = e.DataRow("姓名") Then
MessageBox.Show("此客户今天订单已录入,请查询客户姓名并加录订单!")
e.Cancel = True
End If
End If
这个写在
DataColChanging
有错?
为什么试了几次都不行,老师帮忙检查下,谢谢
碰到一个问题:
If e.DataCol.Name = "姓名" Then
Dim dr As DataRow
dr = e.DataTable.Find("姓名 = '" & e.NewValue & "'")
If dr IsNot Nothing And dr("发货日期") = e.DataRow("发货日期") Then
MessageBox.Show("此客户今天订单已录入,请查询客户姓名并加录订单!")
e.Cancel = True
End If
End If
If e.DataCol.Name = "发货日期" Then
Dim dr As DataRow
dr = e.DataTable.Find("发货日期 = #" & e.newValue & "#")
If dr IsNot Nothing And dr("姓名") = e.DataRow("姓名") Then
MessageBox.Show("此客户今天订单已录入,请查询客户姓名并加录订单!")
e.Cancel = True
End If
End If
这个写在
DataColChanging
有错?
为什么试了几次都不行,老师帮忙检查下,谢谢
这样写,当日起相同的时候,姓名无法相同,但是当姓名相同的时候,日期相同却没有提示对话框出现
DataColChanged事件:
这个代码运行错误