我有一个奖励表。 想从奖励来源表引用过来数据。
代码如下
If e.DataCol.Name = "学号" Then
Dim nms() As String = {"奖励名称","时间","级别"}
If e.NewValue Is Nothing Then
For Each nm As String In nms
e.DataRow(nm) = Nothing
Next
Else
Dim dr As DataRow
dr = DataTables("奖励来源").Find("[学号] = '" & e.NewValue & "'")
If dr IsNot Nothing
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
End If
End If
End If
现在我有两个问题 :第一个: 要是奖励表没有这个学号,我想从奖励来源表。将这个学号导入。这个代码该如何修改?
第二个:If dr IsNot Nothing
For Each nm As String In nms
e.DataRow(nm) = dr(nm)
Next
End If
这里 if dr isNot Nothing 后面。居然没有 then 。 这个语句咋还能运行?
[此贴子已经被作者于2015/6/14 19:33:48编辑过]