如题:
1、表A有,【原始地】【目的地】【国际or国内】
2、表B有,【地区三字代码】【国际国内】
3、经过如下语句,给表A【国际or国内】列赋值。
Select Case e.DataCol.name '国际or国内
Case "起始地","目的地"
Dim UP1 As String
Dim DW1 As String
Dim NY As String
If e.DataRow.IsNull("起始地") OrElse e.DataRow.IsNull("目的地") Then
e.DataRow("国际or国内") = Nothing
ElseIf e.DataRow("起始地") <> Nothing Then
Dim UPAAA As DataRow
UPAAA = DataTables("地区货币能力表").Find("[地区三字码] = '" & e.NewValue & "'")
If UPAAA IsNot Nothing Then
UP1 = UPAAA("国际国内")
End If
ElseIf e.DataRow("目的地") <> Nothing Then
Dim DWAAA As DataRow
DWAAA = DataTables("地区货币能力表").Find("[地区三字码] = '" & e.NewValue & "'")
If DWAAA IsNot Nothing Then
DW1 = DWAAA("国际国内")
End If
ElseIf UP1 <> "国内" OrElse DW1 <> "国内" Then
NY = "国际"
ElseIf UP1 = "国内" And DW1 = "国内" Then
NY = "国内"
If NY IsNot Nothing Then
e.DataRow("国际or国内") = NY
Else
e.DataRow("国际or国内") = "错误"
End If
End If
End Select
[此贴子已经被作者于2015/4/30 13:07:51编辑过]