A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Selected subform record becomes unselected after code runs



 
 
Thread Tools Display Modes
  #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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:12 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.