Case "证据保存清单"
Forms("证据保存清单").open
MainTable = Tables("zhengjudengjibaochunqindan")
With CurrentTable
Dim r As Integer
r = .FindRow("[ajdjh] Like '%" & Forms("目录窗口").Controls("Label2").Text.Replace("[", "@").Replace("]", "#").Replace("@", "[[]").Replace("#", "[]]") & "%'") '从 第一行开始查找
If r >= 0 Then '如果找到的话
.Position = r '定位到找到的行.
Else
Tables("zhengjudengjibaochunqindan").AddNew()
Tables("zhengjudengjibaochunqindan").current("ajdjh")=Tables("ybchengxu").current("ajdjh")
End If
End With
'If forms("证据保存清单").opened Then
'Tables("zhengjudengjibaochunqindan").AddNew()
'Tables("zhengjudengjibaochunqindan").current("ajdjh")=Tables("ybchengxu").current("ajdjh")
'End If
Dim i As Integer
For i = DataTables("zhengjudengjibaochunqindan").DataRows.Count-1 To 0 Step -1
Dim dr As DataRow = DataTables("zhengjudengjibaochunqindan").DataRows(i)
Dim dr2 As DataRow = DataTables("zhengjudengjibaochunqindan").Find("ajdjh='" & dr("ajdjh") & "' and zjqdhm='" & dr("zjqdhm") & "' and _Identify <> " & dr("_Identify"))
If dr2 IsNot Nothing Then
dr2.Delete
End If
Next
Tables("zhengjudengjibaochunqindan").Current.Save()