I've go a main form for my contacts that shows all the contact fields. And I have a subform, datasheet view, that shows all contacts. I have a click event in the contact's name that calls a function on the main form so the main form moves to that record. During this event, the subform cursor always moves to the first record.
I should state that this behavior only started recently after adding some other code and functions to the form. I've moved the other functions, deleted them, etc. and the behavior hasn't quit. When I first enter the form, everything is OK, but at some point, something changes. I've checked the cycle propery on my subform and it is set to 0 all the time, even during the bad behavior (all records?). No errors are being raised. Here's the code:
'This is a click event in the company name on the subform
Private Sub txtCompany_Click()
If Me.NewRecord = False Then
strBusinessPhone = Me.txtBusinessPhone
'This function is on my main form and gets called by the above click event
Public Function fncGoToID(strBusinessPhone As String)
If strBusinessPhone = Me.txtBusinessPhone Then Exit Function
Set rst = Me.RecordsetClone
rst.FindFirst "[BusinessPhone] = '" & strBusinessPhone & "'"
If Not rst.EOF Then
'Here is where the move on the subform occurs
Me.Bookmark = rst.Bookmark
Set rst = Nothing