I've searched this forum (and the Access Forms forum) and found some help, but the code I came up with doesn't work. I'm trying to display a record on a form based on the value of a field on a different form. Sometimes this did take me to the correct record, but I haven't figured out why. For example, the first attempt may succeed, but subsequent attempts would fail. There is no error message, but the form does not advance to the record. This code would be executed from the form SomeForm by a button click as the last part of a larger module, but for now I just have it as it's own module with the form frmAgent open.
Dim strID As String
strID = Forms!SomeForm!SomeField
Dim rst As Dao.Recordset
Set rst = Forms.frmAgent.RecordsetClone
rst.MoveFirst
rst.FindFirst "[ID] = '" & strID & "'"
Forms.frmAgent.Bookmark = rst.Bookmark
End Function
Dim strID As String
strID = Forms!SomeForm!SomeField
Dim rst As Dao.Recordset
Set rst = Forms.frmAgent.RecordsetClone
rst.MoveFirst
rst.FindFirst "[ID] = '" & strID & "'"
Forms.frmAgent.Bookmark = rst.Bookmark
End Function