我看过这篇文章Referancing form in DoCmd.SearchForRecord when using Navigation form - Access 我遵循@ matt-hall解决方案。它适用于我但它只搜索一条记录。我想在文本框中搜索包含条件的每条记录,直到文件结束。我试过这个
strsearch = DLookup("id_fosas", "memoria_vista1", "apelativo_fosa like" & "'%" & Me.Texto24 & "%'" & "or toponimos like '%" & Me.Texto24 & "%' or bando like '%" & Me.Texto24 & "%'")
With Me.Form
Set oRs = .RecordsetClone
oRs.FindFirst "id_fosas=" & strsearch
Do Until oRs.EOF
If oRs.NoMatch Then
MsgBox "Subform record not match to mainform record"
Else
oRs.MoveNext
Me.Bookmark = oRs.Bookmark
End If
Loop
End With
End Sub
但是这个过程使表单在一次单击中从头到尾,并给出错误。我希望每次单击都会将您带到包含用户提供的条件的每条记录,直到文件结束。有人可以帮忙吗? 在此先感谢!!