View Single Post
  #1  
Old May 21st, 2010, 09:38 PM posted to microsoft.public.access.forms
M Skabialka
external usenet poster
 
Posts: 570
Default Selected subform record becomes unselected after code runs

After figuring out that you can't use a Split Form in Access 2007 as a
subform, I went back to the old way of adding a datasheet view subform to my
subform. (main, subfrm, subsubfrm). If the user clicks on a record selector
on the subsubfrm datasheet, the subfrm goes to that record. However for
some reason the record highlighted in the subsubfrm datasheet is no longer
highlighted - it goes back to the first record. But if I put in a break
point and step through the code, when it is done the selected record is
still highlighted. The code is simple, nothing else happens on either form,
on current or anything...

Dim tempID As Integer
tempID = Me!ID
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[ID] = " & Str(Nz(tempID, 0))
If Not rs.EOF Then Me.Bookmark = rs.Bookmark

Why would my subsubfrm go back to the first record if I don't step through
the code, but remain on the selected record if I do step though?

Mich