Selecting current record in subform after removing filter

J

jaf

I have a subform that is filtered based on combo boxes on the main form.
When I programmatically remove the filter and click on a record in the
subform to make it the current record it returns to the first record on the
subform. If I click a second time on the same record it becomes the current
record. If I want to select a different record I have to repeat the two-click
process to make it current.

Below is my code to remove the filter and to synch the main and subforms.
The synch works fine after I remove the filter. But when I select a different
record on the subform it makes it the current record on the main form but
then the subform reverts back to first record again.

Private Sub cmdAllPts_Click()
Forms![frmHeartInitial]![frmMainPtListsubform].Form.Filter = ""
Forms![frmHeartInitial]![frmMainPtListsubform].Form.FilterOn = False
[cboPtStatus] = ""
[cboTxStatus] = ""
Call SynchParentWithSub
End Sub

Private Sub SynchParentWithSub()
Forms![frmHeartInitial].RecordsetClone.FindFirst "[MRN] = " & Me![MRN]
Forms![frmHeartInitial].Bookmark =
Forms![frmHeartInitial].RecordsetClone.Bookmark
End Sub

This code works fine in the Access 97 version of my application but I have
the problem detailed above after converting the application to Access 2003.
Any ideas as to why this is happening?
 
J

jaf

I was able to implement a patch in my code that achieved the desired
functionality. The main form and subform are not bound to each other so I was
synching the forms programmatically. But after applying a filter to the
subform I needed to bookmark the subform in code as well. Why the filtering
required the additional code I do not know.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top