老师,怎样在目录树表有空的行或空的单元格下同样还能自动输入。
If e.DataCol.Name = "一级明细" OrElse e.DataCol.Name = "二级明细" Then
Dim dr As DataRow = e.DataRow
Dim sr As DataRow
sr = DataTables("目录树").SQLFind("[目录类别] = '" & dr("一级明细") & "' And [目录名称] = '" & dr("二级明细") & "'") '在后台查找符合条件的行
If sr IsNot Nothing Then '如果找到了符合条件的行
dr("规格") = sr("规格型号")
dr("单位") = sr("单位")
Else
dr("规格") = Nothing
dr("单位") = Nothing
End If
End If