Dim nms1() As String = {"产妇姓名","产后诊断","孕次","产次","孕周","胎儿娩出时间","新生儿性别"} '新生儿出生表中的列名
Dim nms2() As String = {"产妇姓名","产后诊断","孕次","产次","孕周","胎儿娩出时间","新生儿性别"} '产妇信息表中的列名
If e.NewValue Is Nothing Then
For Each nm As String In nms1
e.DataRow(nm) = Nothing
Next
Else
Dim dr As DataRow
dr = DataTables("产妇信息表").Find("[住院号] = '" & e.NewValue & "'")
If dr IsNot Nothing
For i As Integer = 0 To nms2.length -1
e.DataRow(nms1(i)) = dr(nms2(i))
Next
End If
End If
End If '新生儿出生明细表,从"产妇信息表"中提取数据.
If e.DataCol.name="胎儿娩出时间" Then
e.DataRow("年份")=format(e.DataRow("胎儿娩出时间"),"yyyy年")
End If