Select Case e.DataCol.Name Case "进店视力左眼","进店视力右眼","进店视力双眼","最近测视右眼","最近测视左眼","最近测视双眼","最近测视时间"
If e.DataCol.Name = "客户编号" AndAlso e.DataRow.IsNull("客户编号")=False Then
Dim dr21 As DataRow
Dim dr22 As DataRow
Dim dr23 As DataRow
Dim dr24 As DataRow
Dim dr25 As DataRow
Dim dr26 As DataRow
dr21 = DataTables("理疗管理").Find("[客户编号] = '" & e.DataRow("客户编号") & "' and [左裸眼视力] Is not Null","_Identify") ' 找出该客户编号左眼第一次视力值
dr22 = DataTables("理疗管理").Find("[客户编号] = '" & e.DataRow("客户编号") & "' and [右裸眼视力] Is not Null","_Identify") ' 找出该客户编号右眼第一次视力值
dr23 = DataTables("理疗管理").Find("[客户编号] = '" & e.DataRow("客户编号") & "' and [双裸眼视力] Is not Null","_Identify") ' 找出该客户编号双眼第一次视力值
dr24 = DataTables("理疗管理").Find("[客户编号] = '" & e.DataRow("客户编号") & "' and [左裸眼视力] Is not Null","_Identify Desc") ' 找出该客户编号右眼最后一次视力值
dr25 = DataTables("理疗管理").Find("[客户编号] = '" & e.DataRow("客户编号") & "' and [右裸眼视力] Is not Null","_Identify Desc") ' 找出该客户编号左眼最后一次视力值
dr26 = DataTables("理疗管理").Find("[客户编号] = '" & e.DataRow("客户编号") & "' and [双裸眼视力] Is not Null","_Identify Desc") ' 找出该客户编号双眼最后一次视力值
If dr21 IsNot Nothing Then
e.DataRow("进店视力左眼") = dr21("左裸眼视力")
End If
If dr22 IsNot Nothing Then
e.DataRow("进店视力右眼")=dr22("右裸眼视力")
End If
If dr23 IsNot Nothing Then
e.DataRow("进店视力双眼")=dr23("双裸眼视力")
End If
If dr24 IsNot Nothing Then
e.DataRow("最近测视左眼")=dr24("左裸眼视力")
End If
If dr25 IsNot Nothing Then
e.DataRow("最近测视右眼")=dr25("右裸眼视力")
End If
If dr26 IsNot Nothing Then
e.DataRow("最近测视双眼")=dr26("双裸眼视力")
e.DataRow("最近测视时间")=dr26("理疗时间")
End If
End If
End Select
又在收费管理表中DataColChanged事件中写了以下代码
Select Case e.DataCol.Name
Case "应收金额","实收金额","优惠金额","总次数","剩余次数","消费名称"
Dim pr As DataRow
pr = DataTables("客户管理").Find("客户编号 = '" & e.DataRow("客户编号") & "'")
If pr IsNot Nothing Then
DataTables("客户管理").DataCols("客户编号").RaiseDataColChanged(pr)
End If
End Select
当收费管理表中的 消费名称列变化是,老是报错,请大师们帮忙。