Private Sub aaa_DblClick(Cancel As Integer)
Select Case Me.查看窗口参数ID
Case 1
Case Else
Dim rs As Recordset
Set rs = Me.RecordsetClone
Dim rs1 As New ADODB.Recordset
If Not Me.链接表参数ID1 = 1 Then
rs1.Open Me.链接表名称.Value, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
For i = 0 To rs.Fields.Count - 1
If Me.链接项 = rs.Fields(i).Name Then
rs1.Find "[" & Me.链接项 & "]=" & str(rs.Fields(i).Value)
If Not rs1.EOF Then
For j = 0 To rs1.Fields.Count - 1
If Me.数据ID项 = rs1.Fields(j).Name Then
DoCmd.OpenForm Me.窗口名称, , , , , , rs1.Fields(j).Value
Exit For
End If
Next
End If
Exit For
End If
Next
Else
For i = 0 To rs.Fields.Count - 1
If Me.数据ID项 = rs.Fields(i).Name Then
rs.Bookmark = Me.Bookmark
DoCmd.OpenForm Me.窗口名称, , , , , , rs.Fields(i).Value
Exit For
End If
Next
End If